Description Sets the properties of a Coil surface type in the FRED document as parameterized by its helix radius, cross section radius, pitch and turn count.
Syntax SetCoil cNode, ent, hRad, cRad, pitch, turns
Parameters cNode As Long Node number of the Coil surface whose properties are being set.
ent As T_ENTITY Structure which contains the basic information about the coil surface being set (name, description, parent, etc.)
hRad As Double Major radius of the coil.
cRad As Double Minor radius of the cross section (cannot be greater than half the pitch).
pitch As Double Distance between neighbor coil turns.
turns As Double Number of coil turns (can be non-integer).
Remarks
Example The following code example finds a coil surface and gets its properties, modifies the parameters, sets the new values into the coil surface, re-sizes the trim volume appropriately and then updates the document.
Dim ent As T_ENTITY Dim tVol As T_TRIMVOLUME Dim hRad As Double, cRad As Double, pitch As Double, turns As Double Dim cNode As Long
'get the node id number for the coil surface cNode = FindFullName( "Geometry.CoilCustomElement.Scripted Coil" )
'get the properties of the coil GetCoil cNode, ent, hRad, cRad, pitch, turns
'modify the coil properties hRad = 10 cRad = 1 pitch = 2.1 turns = 10
'set the new properties of the coil SetCoil cNode, ent, hRad, cRad, pitch, turns
're-size the trim volume appropriately Dim zMin As Double, zMax As Double GetTrimVolume cNode, tVol zMin = - cRad zMax = pitch*turns + cRad tVol.zSemiApe = (zMax - zMin)/2 tVol.zCenter = tVol.zSemiApe + zMin tVol.xSemiApe = hRad + cRad + 0.01 tVol.ySemiApe = tVol.xSemiApe SetTrimVolume cNode, tVol
'update the document Update
See Also
|