Navigation: Scripting Reference Manual > Functions & Subroutines > GetCoil

 

GetCoil

 

Contact Us: fredsupport@photonengr.com

 

Description

Retrieves the properties of a Coil surface type from the FRED document as parameterized by its helix radius, cross section radius, pitch and turn count.

 

Syntax

GetCoil cNode, ent, hRad, cRad, pitch, turns

 

Parameters

cNode As Long

Node number of the Coil surface whose properties are being retrieved.

 

ent  ( T_ENTITY )

Returned structure which will contain the basic information about the coil surface being queried (name, description, parent, etc.)

 

hRad ( Double )

Returned major radius of the coil.

 

cRad ( Double )

Returned minor radius of the cross section.

 

pitch ( Double )

Returned distance between neighbor coil turns.

 

turns ( Double )

Returned 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

Coil Surface

AddCoil Function

SetCoil Subroutine

 

 

 

 

 

Copyright © Photon Engineering, LLC