Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: PeteC on February 28, 2023, 02:52:59 am

Title: How can I identify the type of object in a script?
Post by: PeteC 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?
Title: Re: How can I identify the type of object in a script?
Post by: Geert Bellekens 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