Book a Demo

Author Topic: iterate through connectors  (Read 3783 times)

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
iterate through connectors
« on: February 11, 2021, 01:40:52 pm »
Hi,
I would like to update a MDG tag with a value that reflects the number of connectors for an Archimate application, so we can establish which applications are heavily integrated and which ones are not. So I am looking to using a ShapeScript to do it.

Does anyone know if this is possible, and iif so, what is the code like?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: iterate through connectors
« Reply #1 on: February 11, 2021, 02:12:35 pm »
Hi,
I would like to update an MDG tag with a value that reflects the number of connectors for an Archimate application, so we can establish which applications are heavily integrated and which ones are not. So I am looking to using a ShapeScript to do it.

Does anyone know if this is possible, and if so, what is the code like?
Hi David,
A shapescript is not used for this purpose.  It is used to render the item on a diagram.  It can react to MDG tags, but it can't affect them.

You'll need to use a script from the scripting portal (e.g. VBScript, JScript, Javascript etc.).  You'll find sample scripts in the portal.  After you've had a look, come back with any questions.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: iterate through connectors
« Reply #2 on: February 11, 2021, 06:51:30 pm »
You "could" do that in a shape script by calling an add-in operation. However, due to performance consideration that is not recommended (and I stayed away from it ever since). Using a script like Paolo suggested is a more reasonable approach.

q.

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: iterate through connectors
« Reply #3 on: February 12, 2021, 03:43:44 pm »
Ok thanks guys