Hi All,
How can I get all Blocks in the Package using OpenAPI and Beanshell?
Thanks,
Tesla011
Moderator: Moderators
Project project = Application.getInstance().getProject();
if (!SessionManager.getInstance().isSessionCreated(project)){
SessionManager.getInstance().createSession(project,"MySession");
}
String idPackage = ... ;
Package thePackage = project.getElementByID(idPackage);
Collection<PackageableElement> allElements = thePackage.getPackagedElement();
for (PackageableElement ele : allElements) {
if(StereotypesHelper.hasStereotype(ele, "Block")){
print("Found: " + ele.getName());
}
}
SessionManager.getInstance().closeSession();
Return to Programmatic Extendibility
Users browsing this forum: No registered users and 0 guests