Ice
Ice

Reputation: 303

EA query to get allocated part

I created an addin for EA and trying to run a query to know for a specific part on which parts is allocated. For example (see picture attached) I want to know for part A on what parts is allocated, should appear B and C.

Also I need methods in C# for addin:

  1. to delete allocation a
  2. to add allocation for a specific part. Example: I want to allocate part T to Part B from C# code

Property A << allocate >> to property B

enter image description here

I'm searching in t_object for type Abstraction, maybe this is not the good EA table

Upvotes: 0

Views: 71

Answers (1)

Geert Bellekens
Geert Bellekens

Reputation: 13786

You should look into the EA.Element.Connectors collection.

You can use that collection to loop the existing connectors and check their Stereotype property for the value "allocate"

Use the EA.Element.Connectors.AddNew("name", "type") method to add a new connector. Select an existing connector in the GUI and look into the stereotypes field for the correct fully qualified stereotype name to be used as the type parameter. (something like ProfileName::StereotypeName)

Use the EA.Element.Connectors.Delete(index) method to delete connectors.

More details in the documentation for Element, Connector and Collection

If you are trying to use Repository.SQLQuery() to search for the allocated element, you should look into the t_connector table.

Upvotes: 2

Related Questions