Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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
ObjectType.otDiagram
from within one of the supported scripting languages?
I've tried "Repository.ObjectType.otDiagram" and "EA.ObjectType.otDiagram" but they're undefined.
Cheers,
Andrew.
-
Andrew,
I don't use scripting, but in my Visual Studio
EA.ObjectType.otDiagram is a valid enumeration.
Geert
-
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.
-
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.
-
It's not a big deal to me, once I figured out how to set the appropriate integer values.