Author Topic: Linking Part Properties with Composite Aggregations  (Read 1400 times)

jfranflorez

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Linking Part Properties with Composite Aggregations
« on: May 17, 2024, 05:38:34 am »
Hi Everbody,

When one create a Composite Aggregation on  a Diagram this automatically creates a Parts and it links the Role Name of the COmposite Aggregation with the name of the Part, such that if the Role Name is changed the part name is also changed.

I wish to have the above behavior but through a Script.

Currenlty  I am creating parts first in the browser automatically via a VBA Script, but since parts created in the browser do not automatically create Composite Aggregations I proceed to create the composite aggregations per Script as well.

But the created parts and aggregation are not related to each other, so the the above mentioned role name changes in the aggregation reflect automatically in the part.

Does anybody now how one can tell EA, that a certain composite aggregation corresponds to a certain Part.

Thanks

Bo

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Linking Part Properties with Composite Aggregations
« Reply #1 on: May 17, 2024, 07:35:02 pm »
Offline right now, but a Part is in t_object with PDATA1 containing the GUID of its classifier.

q.

jfranflorez

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Linking Part Properties with Composite Aggregations
« Reply #2 on: June 01, 2024, 12:03:04 am »
Yes, but this is the relationship between the part and its classifier. What I want is to relate a part created via script , with a composite aggregation that was also created via scipt.

So an example:

If I have three Blocks Sys, SubSysA, SubSysB and draw composite aggregation relationships between them in EA, EA will automatically create parts under the Sys Block and EA will automatically relate a name change in the Composite Aggregation "Source Role" to the Name of the corresponding created Part

As soon as one draws the composite agreggations we get the Sys Block with two unnamed parts:
Sys
:SubSysA
:SubSysB

If one updates the source roles of the composite aggregations to ssA and ssB then EA automatically updates the names of the parts and one gets:

Sys
ssA:SubSysA
ssB:SubSysB

So the above example is the default behavior when modelling within the tool and now I wish to make this work via script.


What I do in my script is the following:

First I create the parts via Script and thus get:

Sys
ssA:SubSysA
ssA:SubSysB

Then I create the composite aggregations from Sys to SubSysA and from Sys to SubSysB.

Now the issue is that thevia script created composite aggregations are not related to the previously created parts, how can I tell EA, that those composite aggregations correspond to specific parts?

« Last Edit: June 01, 2024, 12:06:33 am by jfranflorez »