Author Topic: How can I identify the type of object in a script?  (Read 1816 times)

PeteC

  • EA User
  • **
  • Posts: 91
  • Karma: +1/-0
    • View Profile
How can I identify the type of object in a script?
« on: February 28, 2023, 02:52:59 am »
I have a VB script in which I want to identify whether an object is a Package, Diagram or Element. I've attempted wrapping a Try/End Try statement around an assignment of the PackageGUID etc. but that seems to be unsupported. Is there a way of doing that?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How can I identify the type of object in a script?
« Reply #1 on: February 28, 2023, 04:03:49 am »
All objects in the API support the property ObjectType. You can use that to distinguish between different object types.

IIRC there are a few examples in the standard scripts.

Geert