Author Topic: Diagram ID from a UML Diagram Element  (Read 3075 times)

philchudley

  • EA User
  • **
  • Posts: 736
  • Karma: +20/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Diagram ID from a UML Diagram Element
« 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
follow me on Twitter

@SparxEAGuru

Andrew Taylor

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Diagram ID from a UML Diagram Element
« Reply #1 on: June 03, 2009, 07:46:17 am »
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
« Last Edit: June 03, 2009, 01:46:18 pm by AndrewTaylor »