Author Topic: True Nesting Connector  (Read 4551 times)

Sygnus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
True Nesting Connector
« 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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: True Nesting Connector
« Reply #1 on: September 29, 2010, 09:39:32 am »
Quote
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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Sygnus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: True Nesting Connector
« Reply #2 on: September 29, 2010, 11:40:55 am »
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?


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: True Nesting Connector
« Reply #3 on: September 29, 2010, 03:15:33 pm »
Element.ParentID if the parent is an Element, Element.PackageID if the parent is a Package.

Geert

Sygnus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: True Nesting Connector
« Reply #4 on: September 29, 2010, 11:28:46 pm »
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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: True Nesting Connector
« Reply #5 on: September 29, 2010, 11:30:57 pm »
Marcelo,

Scripts and addins use the exact same API.

Geert