|
Description
Retrieves the i'th parameter value from an element primitive.
Syntax
val = ElemGetParmValue( epNode, i )
Parameters
val (Variant)
Returned value of the i'th parameter of the element primitive being queried.
epNode As Long
Node number of the element primitive whose i'th parameter value is being retrieved.
i As Variant
Zero-based index of the parameter whose value is being retrieved. This argument can either be the zero-based index identifier of the parameter or the string name identifier of the parameter as returned by the ElemGetParmName function. See the table below for a complete listing of the parameters for each element primitive type.
Remarks
If invalid arguments are encountered the script will return an error message and operation is halted. The following error messages may occur:
"Error: The specified node is not a primitive element."
Indicates that argument epNode is not an element primitive.
"Error: The parameter index is out of bounds."
Indicates that argument ii is not a valid parameter for the element primitive.
Example
The following example references the node number of an existing Cube type element primitive, prints the number of parameters which define it and the parameter description, sets parameter with string name "a" (zero-based index identifier 0) to have a value of 3 using ElemSetParmValue, sets the materials 1 and 2 for all surfaces in the element primitive to be Air (0) and Simple Glass (2) using ElemSetMaterials, sets the coating for all surfaces in the element primitive to be Transmit (2) using ElemSetCoating, sets the raytrace control set for all surfaces in the element primitive to be Transmit Specular (1) using ElemSetRaytraceCtrl and adds the Black Lambertian (0) scatter model to all surfaces in the element primitive using ElemAddScatter.
Sub Main
epNode = FindFullName("Geometry.Cube")
Print "epNode has " & ElemGetParmCount(epNode) & " parameters (zero based index)."
For ii = 0 To ElemGetParmCount(epNode)-1
Print "Parameter index " & ii & " is " & ElemGetParmDescription(epNode, ii)
Print "Parameter index " & ii & " has string name " & Chr(34) & ElemGetParmName( epNode, ii ) & Chr(34)
Next ii
ElemSetParmValue epNode,"a", 3
ElemSetMaterials epNode, 0, 2
ElemSetCoating epNode, 2
ElemSetRaytraceCtrl epNode, 1
ElemAddScatter epNode, 0
Update
End Sub
The code above prints the following information to the output window:
epNode has 2 parameters (zero based index).
Parameter index 0 is Semi-aperture
Parameter index 0 has string name "a"
Parameter index 1 is Location of element origin
Parameter index 1 has string name "d"
Parameter List
|
ID #
|
String Name
|
Description
|
Possible Values
|
|
Beveled Wedge
|
|
0
|
a
|
X semi-aperture
|
value > 0
|
|
1
|
b
|
Y semi-aperture
|
value > 0
|
|
2
|
c
|
Bevel Thickness
|
value > 0
|
|
3
|
d
|
Wedge Angle (degrees)
|
0 < value > 85
|
|
Block
|
|
0
|
a
|
X semi-aperture
|
value > 0
|
|
1
|
b
|
Y semi-aperture
|
value > 0
|
|
2
|
c
|
Z semi-aperture
|
value > 0
|
|
3
|
d
|
Location of origin
|
0
1
2
3
4
5
6
|
(+x)right side
(-x)left side
(+y)top side
(-y)bottom side
(+z)front side
(-z)back side
center of block
|
|
Circular Pyramid
|
|
0
|
a
|
Base semi-aperture
|
value > 0
|
|
1
|
b
|
Height
|
value > 0
|
|
Coil
|
|
0
|
a
|
Helix Radius
|
value > 0
|
|
1
|
b
|
Circle Radius
|
Helix Radius/2 > value > 0
and
Pitch/2 > value > 0
|
|
2
|
c
|
Pitch
|
value > 0
|
|
3
|
d
|
Number of Turns
|
value > 0
|
|
Compound Parabolic Concentrator
|
|
The CPC element primitive does not use the standard Get/SetParmValue commands due to the complex parameter dependencies which define the geometry. Please see the CPC specific commands:
ElemGetCPC
ElemSetCPC
|
|
Cube
|
|
0
|
a
|
Semi-aperture
|
value > 0
|
|
1
|
d
|
Location of Origin
|
0
1
2
3
4
5
6
|
(+x)right side
(-x)left side
(+y)top side
(-y)bottom side
(+z)front side
(-z)back side
center of cube
|
|
Cylinder
|
|
0
|
a
|
Semi-aperture
|
|
value > 0
|
|
1
|
b
|
Length
|
|
value > 0
|
|
2
|
c
|
Location of cylinder surface
|
0
1
2
|
(+Z) front end
(-Z) back end
center of cylinder surface
|
|
Cylinder Lens
|
|
0
|
a
|
X semi-ap
|
value > 0
|
|
1
|
b
|
Y semi-ap
|
value > 0
|
|
2
|
c
|
Z thickness
|
value > 0
|
|
3
|
d
|
Y curvature
|
value <= 0.9 / Y semi-ap
|
|
4
|
e
|
Aperture shape
|
0
1
|
Ellipse
Rectangle
|
|
5
|
f
|
Element origin surface
|
0
1
|
First surface
Second surface
|
|
6
|
g
|
Lens orientation
|
0
1
|
Plane at first surface
Y Toroid at first surface
|
|
Frustum
|
|
0
|
a
|
Base X semi-ap
|
value > 0
|
|
1
|
b
|
Base Y semi-ap
|
value > 0
|
|
2
|
c
|
Top X semi-ap
|
value > 0
|
|
3
|
d
|
Top Y semi-ap
|
value > 0
|
|
4
|
e
|
Depth
|
value > 0
|
|
5
|
f
|
Type
|
0
1
|
Ellipse
Rectangle
|
|
Ellipsoid
|
|
0
|
a
|
X semi-aperture
|
value > 0
|
|
1
|
b
|
Y semi-aperture
|
value > 0
|
|
2
|
c
|
Z semi-aperture
|
value > 0
|
|
Hemisphere Shell
|
|
0
|
a
|
Outer radius
|
value > 0
|
|
1
|
b
|
Wall thickness
|
Outer Radius > value > 0
|
|
Hemisphere Solid
|
|
0
|
a
|
Radius
|
value > 0
|
|
1
|
b
|
Element origin surface
|
0
1
|
First Surface
Second Surface
|
|
2
|
c
|
Hemisphere Orientation
|
0
1
|
Plane at first surface
Hemisphere vertex at first surface
|
|
Hemisphere Surface
|
|
0
|
a
|
Radius
|
value > 0
|
|
Ideal Lens Module
|
|
0
|
a
|
X semi-aperture
|
value > 0
|
|
1
|
b
|
Y semi-aperture
|
value > 0
|
|
2
|
c
|
Hole X semi-aperture
|
0 < value < X semi-aperture
|
|
3
|
d
|
Hole Y semi-aperture
|
0 < value < Y semi-aperture
|
|
4
|
shape
|
Aperture shape
|
0
1
|
rectangular/square
elliptical/circular
|
|
5
|
type
|
Lens module type
|
0
1
2
3
4
|
Simplified Infinite Object (non-Eikonal)
Perfect Infinite Object (Eikonal)
Perfect Finite Conjugate (Eikonal)
Perfect Afocal (Eikonal)
Sphere Surface (Eikonal)
|
|
If type = 0 [Simplified Infinite Object (non-Eikonal)]
|
|
6
|
FD
|
Focal Distance
|
Any value
|
|
7
|
Mapping
|
Mapping between input angle and image height
|
0
1
2
|
F-Tan (theta)
F-Sin (theta)
F-theta
|
|
If type = 1 [Perfect Infinite Object (Eikonal)]
|
|
6
|
FL
|
Focal Length
|
Any value
|
|
7
|
This parameter is unused.
|
|
If type = 2 [Perfect Afocal (Eikonal)]
|
|
6
|
FL
|
Focal Length
|
Any value
|
|
7
|
M
|
Magnification
|
Any value
|
|
If type = 3 [Perfect Finite Object (Eikonal)]
|
|
6
|
M
|
Pupil magnification (inverse angular magnification)
|
Any value
|
|
7
|
This parameter is unused.
|
|
If type = 4 [Sphere Surface (Eikonal)]
|
|
6
|
Radius
|
Radius of curvature
|
Any value
|
|
7
|
This parameter is unused.
|
|
Multimode Fiber Optic
|
|
0
|
a
|
Fiber core semi-aperture
|
value > 0
|
|
1
|
b
|
Outer semi-aperture
|
0 < value < core semi-aperture
|
|
2
|
c
|
Length
|
value > 0
|
|
3
|
d
|
Location of element origin
|
0
1
2
|
(+Z) front end
(-Z) back end
center of element
|
|
N-Sided Extruded Solid
|
|
0
|
a
|
Number of sides
|
1 < value < 1000
|
|
1
|
b
|
Semi-aperture
|
value > 0
|
|
2
|
c
|
Length
|
value > 0
|
|
3
|
d
|
Location of element origin
|
0
1
2
|
(+Z) front end
(-Z) back end
center of solid element
|
|
N-Sided Extruded Surface
|
|
0
|
a
|
Number of sides
|
2 < value < 1000
|
|
1
|
b
|
Semi-aperture
|
value > 0
|
|
2
|
c
|
Length
|
value > 0
|
|
3
|
d
|
Location of element origin
|
0
1
2
|
(+Z) front end
(-Z) back end
center of solid element
|
|
N-Sided Pipe
|
|
0
|
a
|
Number of sides
|
2 < value < 1000
|
|
1
|
b
|
Outer Semi-aperture
|
value > 0
|
|
2
|
c
|
Wall thickness
|
0 < value < (semi-ape*cos(π/Nsides)
|
|
3
|
d
|
Length
|
value > 0
|
|
4
|
e
|
Location of element origin
|
0
1
2
|
(+Z) front end
(-Z) back end
center of pipe
|
|
N-Sided Plane
|
|
0
|
a
|
Number of sides
|
2 < value < 1000
|
|
1
|
b
|
Semi-aperture
|
value > 0
|
|
N-Sided Pyramid Solid
|
|
0
|
a
|
Number of sides
|
2 < value < 1000
|
|
1
|
b
|
Semi-aperture
|
value > 0
|
|
2
|
c
|
Height
|
value > 0
|
|
Parabolic Trough
|
|
0
|
a
|
Full height
|
value > 0
|
|
1
|
b
|
Full width
|
value > 0
|
|
2
|
f
|
Focal length
|
Any value
|
|
Paraboloid
|
|
0
|
a
|
Semi-aperture
|
value > 0
|
|
1
|
f
|
Focal length
|
Any value
|
|
Pipe
|
|
0
|
a
|
Outer radius
|
value > 0
|
|
1
|
b
|
Wall thickness
|
Outer Radius > value > 0
|
|
2
|
c
|
Length
|
value > 0
|
|
3
|
d
|
Location of origin
|
0
1
2
|
(+z)front end
(-z)back end
center of rod
|
|
Plane
|
|
0
|
a
|
X Semi-aperture
|
value > 0
|
|
1
|
b
|
Y Semi-aperture
|
value > 0
|
|
2
|
c
|
Aperture shape
|
0
1
|
rectangular/square
elliptical/circular
|
|
3
|
d
|
Hole X semi-ap
|
value > 0
|
|
4
|
e
|
Hole Y semi-ap
|
value > 0
|
|
Plane with N-Sided Hole
|
|
0
|
a
|
X Semi-aperture
(semi-width)
|
value > 0
|
|
1
|
b
|
Y Semi-aperture
(semi-height)
|
value > 0
|
|
2
|
c
|
Aperture shape
|
0
1
|
rectangular/square
elliptical/circular
|
|
3
|
d
|
Number of sides
|
2 < value< 1000
|
|
4
|
e
|
Hole Semi-aperture
|
0 < value < (X semi-ape AND Y semi-ape)
|
|
Rod
|
|
0
|
a
|
Radius
|
value > 0
|
|
1
|
b
|
Length
|
value > 0
|
|
2
|
d
|
Location of origin
|
0
1
2
|
(+z)front end
(-z)back end
center of rod
|
|
Sphere
|
|
0
|
a
|
Radius
|
value > 0
|
|
Truncated Ellipsoid
|
|
0
|
a
|
X semi-ap
|
value > 0
|
|
1
|
b
|
Y semi-ap
|
value > 0
|
|
2
|
c
|
Z semi-ap
|
value > 0
|
|
3
|
d
|
Z back face
|
|value| < Z semi-ap
|
|
4
|
e
|
Z front face
|
Z back face < |value|
|
|
Torus
|
|
0
|
a
|
Major radius
|
value > 0
|
|
1
|
b
|
Minor radius
|
Major radius > value > 0
|
|
Wedge
|
|
0
|
a
|
Wedge angle (deg)
|
0 < value < 180
|
|
1
|
b
|
Side length
|
value > 0
|
|
2
|
c
|
Thickness
|
value > 0
|
|
3
|
d
|
Location of origin
|
0
1
2
3
4
5
6
|
(+x) right side
(-x) left side
(+y) top surface
wedge vertex
(+z) front side
(-z) back side
center of wedge
|
|
4
|
e
|
Shape of top surface
|
plane / curve
|
See Also
Element Primitive Script Commands
Element Composite (boolean) Script Commands
|
Copyright © Photon Engineering, LLC
|
|