[S8401] Script for specifying parts by coordinates and setting conditions

 

The following is an example of a script that specifies parts by coordinates and sets conditions.

=== Set the FEM conductor conditions in the 2D model ===

app = designer.GetApplication()

# Specify the title of the FEM conductor condition and specify Conductor Set 1.

Cond = app.GetModel(0).GetStudy(0).GetCondition(u"FEMConductor").GetSubCondition(u"Conductor Set 1")

# Clear the condition component settings

Cond.ClearParts()

# Set the mode to select parts, etc. to be set as conditions.

sel = Cond.GetSelection()

# Set to no selection

sel.Clear() 

# Select parts by specifying coordinates

sel.SelectPartByPosition(5, 30, 0)

# Add selected parts

Cond.AddSelected(sel)
 
=== Set the FEM conductor conditions in the 3D model ===

app = designer.GetApplication()

# Specify the title of the FEM conductor condition and specify Conductor Set 1.

Cond = app.GetModel(0).GetStudy(0).GetCondition(u"FEMConductor").GetSubCondition(u"Conductor Set 1")

# Clear the condition component settings

Cond.ClearParts()

# Set the mode to select parts, etc. to be set as conditions.

sel = Cond.GetSelectionByGroup(0)

# Set to no selection

sel.Clear() 

# Select a face by specifying coordinates

sel.SelectFaceByPosition(5, 30, 0)

# Add selected faces

Cond.AddSelectedByGroup(sel, 0)

# Select parts by specifying coordinates

sel.SelectPartByPosition(5, 30, 0)

# Add selected parts

Cond.AddSelectedByGroup(sel, 2)

How to use script file

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