Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Sygnus on September 29, 2010, 02:06:25 am
-
Is there a way, via script or via addin, for a custom connector to make the target element nest inside the source?
I'd like to have a custom connector that, when dragged from a source element to target element, would move the target inside the source, setting the parent property of the target element to the source and updating the project hierarchy accordingly.
I've seen something like that in the SysML video and would like to know how to repplicate this in my customization.
TIA
Marcelo
-
Is there a way, via script or via addin, for a custom connector to make the target element nest inside the source?
I'd like to have a custom connector that, when dragged from a source element to target element, would move the target inside the source, setting the parent property of the target element to the source and updating the project hierarchy accordingly.
I've seen something like that in the SysML video and would like to know how to repplicate this in my customization.
TIA
Marcelo
You nearly got it Marcelo... You get the script to set the parent property and then it will move after you refresh the browser.
HTH,
Paolo
-
Thanks for both your replies, Paolo,
But regarding this topic, how do I do that? I mean, how do I go and set the parent of an object through script?
-
Element.ParentID if the parent is an Element, Element.PackageID if the parent is a Package.
Geert
-
But this notation is for the automation interfaces, is it not? Is it possible to achieve the same results in scripts? If so, could someone post a small example?
TIA
Marcelo
-
Marcelo,
Scripts and addins use the exact same API.
Geert