[S8389] Script to obtain vertex coordinates from the Geometry Editor

 

The following is an example of a script that obtains the coordinates of vertices in the  Geometry Editor.

app = designer.GetApplication()

# Establish a CAD link and open the Geometry Editor.

app.GetModel(0).RestoreCadLink()

geomApp = app.CreateGeometryEditor()

# Get the Y coordinate of the vertex name “Vertex.1” in the sketch named “Rotor core.”

vol = geomApp.GetDocument().GetAssembly().GetItem(u"Rotor core").GetItem(u"Vertex.1").GetProperty(u"Y")

# Display the acquired value

print(f"{vol}mm")

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.