Author Topic: Access to 'link' in VBA  (Read 3911 times)

PanWojtek

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Access to 'link' in VBA
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Access to 'link' in VBA
« Reply #1 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.