Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: philchudley on March 31, 2009, 10:09:53 pm
-
Does anyone know of a method using the Object Model how to obtain the diagram to which a Diagram reference (UML Diagram Element)?
I am looking to obtain either the diagram ID or the diagram GUID
Cheers
-
Try this:
EA.Repository repo;
EA.Element element;
repo = ..... your repository
element = ...... an element with Type == "UMLDiagram"
int diagram_id = Int16.Parse(element.get_MiscData(0));
EA.Diagram diagram = repo.GetDiagramByID(diagram_id);
Obvious, isn't it? :o