Description Data structure used for retrieving or adding entity pickups.
Definition T_PICKUP active As Boolean description As String dstentity As Long dstindex As Long dstsubindex As Long dsttype As String Function As String op As String parma As Double parmb As Double Script As String srcentity As Long srcindex As Long srcsubindex As Long srctype As String
Members active Boolean flag indicating whether the pickup is active (True) or inactive (False).
description String containing the user-defined description of the pickup.
dstentity Node number of the destination entity. The value being picked up is assigned to this entity.
dstindex Contains the array index for pickup variable types with multiple entries (ex. Position/Orientation). If the pickup variable does not need an index value, -1 is used. See Optimization Variables for index/sub-index specification.
dstsubindex Contains the array sub-index for pickup variable types with multiple entries (ex. Position/Orientation). If the pickup variable does not need a sub-index value, -1 is used. See Optimization Variables for index/sub-index specification.
dsttype Specifies the destination entity variable type being accessed. Valid strings match those provided in the variable type drop down list of the parameter pickup dialog.
Function Specifies the function applied to the source variable value before assignment to the destination entity. Possible string values are:
op Specifies the assignment operator, where x is value retrieved from the source entity and y is the value retrieved/assigned from/to the destination entity. When y is on the right hand side of the equation, the value has been retrieved from the destination entity. When y is on the left hand side of the equation, it is the value being assigned to the destination entity. Possible string values are: = (equal y=x) += (plus-equal y=y+x) -= (minus-equal y=y-x) *= (times-equal y=y*x) /= (divide-equal y=y/x)
parma Parameter A in the function defined by member Function.
parmb Parameter B in the function defined by member Function.
Script String defining the script in a Function of type "(user script)".
srcentity Node number of the source entity. The value being picked up is retrieved from this entity.
srcindex Contains the array index for pickup variable types with multiple entries (ex. Position/Orientation). If the pickup variable does not need an index value, -1 is used. See Optimization Variables for index/sub-index specification.
srcsubindex Contains the array sub-index for pickup variable types with multiple entries (ex. Position/Orientation). If the pickup variable does not need a sub-index value, -1 is used. See Optimization Variables for index/sub-index specification.
srctype Specifies the source entity variable type being accessed. Valid strings match those provided in the variable type drop down list of the parameter pickup dialog.
Example This example loops over all pickups and prints their definitions to the output window. A separate subroutine is used to handle the formatting of the Script member of the T_PICKUP structure in the case where the Function member is "(user script)".
Sub Main
ClearOutputWindow
Dim pCount As Long pCount = GetPickupCount()
Dim tPick As T_PICKUP Dim curPick As Long For curPick = 0 To GetPickupCount()-1 GetPickup( curPick, tPick ) Print "Pickup Description: " & Chr(9) & tPick.Description Print Chr(9) & "Active: " & Chr(9) & tPick.active Print Chr(9) & "Destination:" & Chr(9) & "[" & tPick.dstentity & "]" & Chr(9) & GetFullName(tPick.dstentity) Print Chr(9) & Chr(9) & "Index:" & Chr(9) & tPick.dstindex Print Chr(9) & Chr(9) & "Sub-index:" & Chr(9) & tPick.dstsubindex Print Chr(9) & Chr(9) & "Type:" & Chr(9) & tPick.dsttype Print Chr(9) & "Source:" & Chr(9) & "[" & tPick.srcentity & "]" & Chr(9) & GetFullName(tPick.srcentity) Print Chr(9) & Chr(9) & "Index:" & Chr(9) & tPick.srcindex Print Chr(9) & Chr(9) & "Sub-index:" & Chr(9) & tPick.srcsubindex Print Chr(9) & Chr(9) & "Type:" & Chr(9) & tPick.srctype Print Chr(9) & "Function:" & Chr(9) & tPick.Function Print Chr(9) & "Operation:" & Chr(9) & tPick.op Print Chr(9) & "Parameter A:" & Chr(9) & tPick.parma Print Chr(9) & "Parameter B:" & Chr(9) & tPick.parmb If tPick.Script <> "" Then printScript( tPick.Script ) Else Print Chr(9) & "Script:" & Chr(9) & "None" End If Print "" Next curPick
End Sub
Sub printScript( ByVal pickScript As String )
Print Chr(9) & "Script: "
Dim vals() As Double Dim strs() As String Dim numTokens As Long, curLine As Long numTokens = ParseString( pickScript, Chr(10), vals(), strs() ) For curLine = 0 To UBound( strs,1 ) Print Chr(9) & Chr(9) & strs( curLine ) Next curLine
End Sub
See Also
|