Sparx Systems Forum
Enterprise Architect => Uml Process => Topic started by: dangel on December 16, 2014, 06:41:39 am
-
How can I find all objects of Class or objects of type Use Case in a specific diagram {Diagram_abc} using API ?
Regards
-
Wrong thread, but anyhow:
for diaObj in Diagram. DiagramObjects {
obj = Repository.GetElementById(diaObj.ElementD)
if obj.type == "Object" and obj.ClassifierID = mainClass.ElementID {...}
}
q.
-
Thank you,
Just a question, I am using SQL Query much more than API, is this good,
I am working on multiple relations and objects to analyze diagrams and its properties into C#-DataGrid,,, do you recommend me on this way ?
or move to use pure-API ?
Regards,
-
Like everything it depends. Most operations on the database are rather save since the API layer is rather thin. But when it comes to stereotypes (or a few other things I can't recall) you should stick to the API unless you know exactly what you're doing. But either way: test on sandboxes. Backup regularly.
q.
-
Thank you very much
-
Thank you,
Just a question, I am using SQL Query much more than API, is this good,
I am working on multiple relations and objects to analyze diagrams and its properties into C#-DataGrid,,, do you recommend me on this way ?
or move to use pure-API ?
Regards,
Use the API as much as possible. But keep in mind that iterating anything in EA is very slow.
So for find things SQL is usually the best option. Once you have the ID you can instantiate the object you need using Repository.Get<xxx>ByID
Geert
-
Great :)