[S8451] Script to create probes in 1deg increments in the circumferential direction

 

I want to create probes in 1deg increments in the circumferential direction in a script.

The following is an example in Python script.
# -*- coding: utf-8 -*-

app = designer.GetApplication()

#Probe position setting

r = 27.5 #radius

StartAng = 0 #Angle from the R axis of the cylindrical coordinate system to the nearest probe to be created (deg)

EndAng = 60 #Range angle to probe. Specified as an integer with a maximum value of 359 (deg).

Z = 0 #height

#Create probes in 1deg increments by for loop.

for i in range(EndAng+1):

   #create probe

   objProbe = app.GetCurrentStudy().CreateProbe(str(i) + u"deg")

   #Setting up the created probe

   objProbe.SetResultType(u"MagneticFluxDensity", "") #Result Type

   objProbe.SetResultCoordinate(u"Cylindrical") #Reference Coordinate System

   objProbe.SetComponent(u"All") #Component

   objProbe.SetLocationCoordinate(u"Cylindrical") #Evaluation Coordinate System

   objProbe.ClearPoints() #Delete all positions.

   objProbe.SetProbeType(0) #Set [Type] to [By Coordinate].

   objProbe.SetLocation(0, r, StartAng + i, Z) #Set index number=0 position

   objProbe.RenamePoint(0, u"Point:" + str(i) + u"deg") #Change the position name of index number=0

   objProbe.SetUseElementValue(0) #[Use Element Value] flag (0: OFF, 1: ON)

   objProbe.SetMoveWithPart(1) #[Move with Part] flag (0: OFF, 1: ON)
 

How to use script file

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