Skip to content

Instantly share code, notes, and snippets.

@xcriptus
Created December 10, 2012 21:45
Show Gist options
  • Save xcriptus/4253658 to your computer and use it in GitHub Desktop.
Save xcriptus/4253658 to your computer and use it in GitHub Desktop.
StarUML - Model Exploration - OwnedElement & Namespaces
var staruml = new ActiveXObject("StarUML.StarUMLApplication");
var project = staruml.GetProject();
VisitOwnedElement(project,"");
function VisitOwnedElement(owner,indent){
for (var i = 0; i < owner.GetOwnedElementCount(); i++){
var element = owner.GetOwnedElementAt(i);
// Process the current element
staruml.AddMessageItem(1,indent+element.Name+" : "+element.getClassName(),element) ;
// Recursive call if this is a Namespace
if (element.IsKindOf("UMLNamespace")) {
VisitOwnedElement(element," "+indent);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment