Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: PanWojtek on March 06, 2024, 01:46:56 am

Title: Access to 'link' in VBA
Post by: PanWojtek on March 06, 2024, 01:46:56 am
Hello All,

suppose 'requirment' type, lets call it Req A  has a link: 'propierties->Related->Links' to other requriements (eg: Req B, Req C)

How to get all linked entities in VBA script when printing:
i want to have this:
Req A->Req B
Req A->Req C

dim currentElement as EA.Element
   for each currentElement in currentPackage.Elements
      Session.Output( indent & "::" & currentElement.Name & _
         " (" & currentElement.Type & _
         ", ID=" & currentElement.ElementID & ")" )
   next

seems that class EA.Element does not have any attribute for links - only thing i notice is 'Connectors' attribute which stores number of such links;

BR
PW
Title: Re: Access to 'link' in VBA
Post by: qwerty on March 06, 2024, 09:23:07 pm
Iterate the connectors collection for all those that have either source or target as the desired objectId

q.