Accessing model elements in used projects

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Accessing model elements in used projects

Postby haitong.zhang@boeing.com » Thu Jan 17, 2019 4:05 pm

I am using Cameo 18.5 with Teamwork cloud.

Which OpanAPI should I use to:
1) get the access used projects (project descriptor..)?
2) get model elements in used projects?

Thanks!
haitong.zhang@boeing.com
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:0
Joined: Tue Jul 10, 2018 4:10 pm

Re: Accessing model elements in used projects

Postby gdhardy1 » Mon Jan 21, 2019 10:24 am

The com.nomagic.magicdraw.uml.Finder class will search for elements across the entire project including its project usages. If you want to narrow your search for model elements to a specific used project you should set the Model package for that used project as the root element of your find() method. The easiest way to get the Project Usage model package is to use the getElementByID(string) method in com.nomagic.magicdraw.core.Project. Look at the specification window for the used project to find the "Element Id".
gdhardy1
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:2
Joined: Thu Oct 18, 2018 11:24 am


Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 1 guest