[S8570] Script to remove duplicate nodes in the Geometry Editor

 

The following is an example of a script for removing duplicate nodes in the Geometry Editor.

# Define the range of the rectangular selection

# min is the first point of the rectangle selection, and max is the second point of the rectangle selection.

min_x = 0

min_y = 0

min_z = 0

max_x = 200

max_y = 200

max_z = 200

app = designer.GetApplication()

# Get the object from the Geometry Editor

geomApp = app.CreateGeometryEditor()

# Switch to node selection mode

geomApp.View().SetSelectionType(4)

# Specify selection by sight through

geomApp.View().SetSightThrough(True)

# Since the selection target must be within the display area, the model will be displayed in full view.

geomApp.View().Fit()

# Deselect

geomApp.GetDocument().GetSelection().Clear()

# Select nodes within the specified rectangular area.

geomApp.View().SelectAtBoxDlg(min_x, min_y, min_z, max_x, max_y, max_z, False, 0)

# Create parameters for removing duplicate nodes

param = geomApp.GetDocument().GetMeshManager().CreateDeleteDuplicateNodeParameter()

# Set Tolerances

param.SetProperty("Tolerance", 1e-6)

# Removal of Duplicate Nodes

geomApp.GetDocument().GetMeshManager().Execute(param)

How to use script file

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