Navigation: Scripting Reference Manual > Functions & Subroutines > SetOperation

 

SetOperation

 

Contact Us: fredsupport@photonengr.com

 

Description

Sets the parameters of a specific location/orientation operation for a FRED entity.

 

Syntax

SetOperation n, indx, op

 

Parameters

n As Long

Node number of the FRED object.

 

indx As Long

Zero-based index of Location/Orientation primitive operation.

 

op As T_OPERATION

Structure containing the new Location/Orientation primitive operation data for the FRED entity.

 

Remarks

This subroutine sets a specific Location/Orientation modifier in a specified FRED entity.  If there is a problem, the subroutine posts an error and returns without modifying the FRED object's Location/Orientation.

 

Example

Consider an entity of interest with the following position/orientation operations list as seen in the GUI:

 

 

The following script will retrieve the specifications for operation #1 (the Shift) using the GetOperation subroutine, modify the operation's parameters and then set the modified values back to the entity using the SetOperation subroutine.

 

Sub Main

 

          Dim op As T_OPERATION

          Dim pNode As Long

 

          'Get the node number for the entity being modified.

          pNode = FindFullName("Geometry.Plane")

 

          'Get operation #1 from the entity.  This is the Shift operation.

          GetOperation pNode, 1, op

 

          'Modify the shift values for this operation.

          'Note that although the T_OPERATION structure has 13 "val" members, the Shift operation

          'type only uses val1, val2 and val3.  The remaining "val" members are ignored and therefore

          'do not need to be set.

          op.val1 = 4

          op.val2 = 8

          op.val3 = 12

 

          'Now send the modified values back to the entity and update the document.

          SetOperation pNode, 1, op

          Update

 

End Sub

 

After running this script the operations list for the entity looks like the following:

 

 

 

See Also

Scripting Position/Orientation Operations

T_OPERATION

AddOperation

GetOperation

GetOperationCount

Linear Transformations

 

 

 

 

 

Copyright © Photon Engineering, LLC