# Setting up an object/property link using Python

**URL:** https://discourse.paraview.org/t/setting-up-an-object-property-link-using-python/3731
**Category:** Tips and Tricks
**Tags:** python
**Created:** [March 3, 2020, 2:59pm UTC](https://discourse.paraview.org/t/setting-up-an-object-property-link-using-python/3731 "2020-03-03T14:59:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![debbie-z](https://discourse.paraview.org/user_avatar/discourse.paraview.org/debbie-z/32/3156_2.png) [@debbie-z](https://discourse.paraview.org/u/debbie-z)
#### Post date: [March 3, 2020, 2:59pm UTC](https://discourse.paraview.org/t/setting-up-an-object-property-link-using-python/3731/1 "2020-03-03T14:59:05Z")

</div>

Continuing the discussion from [How to set up an object or property link with python](https://discourse.paraview.org/t/how-to-set-up-an-object-or-property-link-with-python/3321):

See working method below:

```auto
    def AddObjectLink(objProxy, objProxyOther, linkname):
    	""""Create a link between two proxies. A name must be given
        so that the link can be referred to by name. If a link with the given
        name already exists it will be removed first."""
    	objlink = servermanager.vtkSMProxyLink()
    	objlink.AddLinkedProxy(objProxy.SMProxy, 1)
    	objlink.AddLinkedProxy(objProxyOther.SMProxy, 2)
    	objlink.AddLinkedProxy(objProxyOther.SMProxy, 1)
    	objlink.AddLinkedProxy(objProxy.SMProxy, 2)
    	RemoveObjectLink(linkname)
    	servermanager.ProxyManager().RegisterLink(linkname, objlink)

    def RemoveObjectLink(linkName):
    	"""Remove a property link with the given name."""
    	servermanager.ProxyManager().UnRegisterLink(linkName)

```

For example, to link 2 slice planes together:  
`AddObjectLink(slice1.SliceType, slice2.SliceType, "link0")`
