Path Element Style "RECTILINEAR"

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Path Element Style "RECTILINEAR"

Postby » Sat Mar 18, 2023 5:16 am


I create multiple elements and connect them via PathElement. Unfortunately I can't manage to change the style of the Path element to RECTILINEAR. How can I do this?

Code: Select all
// Create Presentation Element
Element1  = ...
Element2  = ...
PresentationElement1   = presentationElementesManager.createShapeElement(Element1, Diagram)
PresentationElement2   = presentationElementesManager.createShapeElement(Element2, Diagram)

// Create Dependency
Dependency = project.getElementsFactory().createDependencyInstance()
ModelElementsManager.getInstance().addElement(Dependency, Parent)
ModelHelper.setClientElement(Dependency, Element1)
ModelHelper.setSupplierElement(Dependency, Element2)

// Create Path
ShowPathElement = presentationElementesManager.createPathElement(Dependency,PresentationElement1,PresentationElement2)

Forum Newbie
Forum Newbie
Posts: 3
Posts Rating:0
Joined: Thu Feb 10, 2022 4:47 am

Re: Path Element Style "RECTILINEAR"

Postby yu3333 » Wed Mar 29, 2023 6:20 am

I suppose you want to Changing properties of presentation elements. Read its documentation here

You can also refer to the following codes, in which presentationElement is the path's PresentationElement

Code: Select all
ChoiceProperty pathStyle = presentationElement.getProperty(PropertyID.LINK_LINE_STYLE);
PropertyManager properties = new PropertyManager();
PresentationElementsManager.getInstance().setPresentationElementProperties(presentationElement, properties);

Hope it helps!
Forum Newbie
Forum Newbie
Posts: 7
Posts Rating:0
Joined: Wed Mar 29, 2023 1:09 am

Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests