MagicDraw 19.0 LTR SP4 Documentation
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
Version 1 Current »
To create a com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement for given ModelElement in the given com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement, use method com.nomagic.magicdraw.openapi.uml.PresentationElementsManager#createShapeElement(...). The location of the created shape will be (0,0).
The following code example shows how to do this:
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class clazz = ...; DiagramPresentationElement diagram = ...; SessionManager.getInstance().createSession("Test"); ShapeElement shape = PresentationElementsManager.getInstance().createShapeElement(clazz, diagram); SessionManager.getInstance().closeSession();
You can find the code examples in