Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Andrew Warner on February 22, 2010, 05:29:40 pm

Title: standard enumeration values in scripts
Post by: Andrew Warner on February 22, 2010, 05:29:40 pm
Hi all,
Is someone able to tell me whether or not it's possible to get the enumeration values like
Code: [Select]
ObjectType.otDiagramfrom within one of the supported scripting languages?

I've tried "Repository.ObjectType.otDiagram" and "EA.ObjectType.otDiagram" but they're undefined.

Cheers,
Andrew.
Title: Re: standard enumeration values in scripts
Post by: Geert Bellekens on February 22, 2010, 06:26:30 pm
Andrew,

I don't use scripting, but in my Visual Studio
EA.ObjectType.otDiagram is a valid enumeration.

Geert
Title: Re: standard enumeration values in scripts
Post by: Shawn Stepper on February 24, 2010, 05:47:25 am
I've had to manually define these in my JScript scripts. They don't seem to be defined anywere.

var otElement = 4;
var otPackage = 5;
var otDiagram = 8;

if (theElement.ObjectType == otElement) {
...
}

where theElement is a handle on an element. You can get the integer values from the list in the Help. The list in the help is in order, and is 0 based.
Title: Re: standard enumeration values in scripts
Post by: mrf on February 24, 2010, 08:30:09 am
Hi Shawn,

They're currently not supported at the moment, but we are working on it (you'll notice that we've defined them as globals in our sample scripts as well). I'd suggest for the meantime that you send in an official bug report so we can get an idea about how you're affected by the problem.
Title: Re: standard enumeration values in scripts
Post by: Shawn Stepper on February 25, 2010, 08:11:29 am
It's not a big deal to me, once I figured out how to set the appropriate integer values.