Public Member Functions | List of all members
Simulation Class Reference

Inherits ScriptObject.

Public Member Functions

 setTargetForId (MachineConfiguration::AxisId axisId, Number axisPosition)
 
 setTargetForCoordinate (Integer coordinate, Number axisPosition)
 
 setTarget (Axis axis, Number axisPosition)
 
 resetTarget ()
 
 moveToTargetInMachineCoords ()
 
 moveToTargetInWorkCoords ()
 
 setMotionToRapid ()
 
 setMotionToLinear ()
 
 setFeedrateToMax ()
 
 setFeedrate (Number feedrate)
 
 performToolChangeCycle ()
 
 setTWPModeAlignToCurrentPose ()
 
 setTWPModeBySpatialAngles (Number angleA, Number angleB, Number angleC)
 
 setTWPModeByEulerAngles (Integer eulerConvention, Number angle1, Number angle2, Number angle3)
 
 setTWPModeOff ()
 
 retractAlongToolAxisToLimit ()
 
Set the target XYZ axes directly. Values are in current units.
 setTargetX (Number x)
 
 setTargetY (Number y)
 
 setTargetZ (Number z)
 
Set the target ABC axes directly. Values are in Radians.
 setTargetA (Number a)
 
 setTargetB (Number b)
 
 setTargetC (Number c)
 
Turn the TCP mode ON or OFF.

When TCP mode is active, the programmed XYZ coordinates will be treated as TCP coordinates, which means they will be in the part's coordinate system and not the XYZ of the machine. In addition, when TCP is active the TCP kinematic interpolation will be switched on. This means that the tool tip will be interpolated linearly relative to the part. However, it is possible that TCP kinematic interpolation will be switched off for rapid moves, depending on the controller configuration.

 setTCPModeOn ()
 
 setTCPModeOff ()
 
Control the rotary traverse mode for any axis where any rotary movement can be made in two directions.

This would be a rotary axis with no physical limits, no restricted limits and that is non-cyclic.

setRotaryToGoShortestDirection() - With this option, any rotary movement will go the shortest direction. In addition, if you specified some larger rotation amount beyond 360 degrees, it will ignore all of the extra rotations. In other words, the largest possible movement will be 180 degrees. If you program an exact 180 degree relative motion, then it will go in the direction as programmed.

setRotaryToGoProgrammedDirection() - With this option, the axis will go in direction of the signed difference, i.e. it will go to whatever value is programmed by the movement. This includes any multiples of 360 degrees. Note that this is the default mode for the simulation.

Important notes:

"Cyclic" rotary axes will behave as if this setting is always ON. ie. this setting has no effect on these axes. Limited rotary axes will behave as if this setting is always OFF. ie. this setting has no effect on these axes.

Examples: (For a support axis)

Start:End:Actual Shortest:Actual As-Programmed:
359.0 deg1.0 deg+2.0 deg-358.0 deg
359.0 deg361.0 deg+2.0 deg+2.0 deg
-180.0 deg180.0 deg+0.0 deg+360.0 deg
0.0 deg740.0 deg+20.0 deg+740.0 deg
 setRotaryToGoShortestDirection ()
 
 setRotaryToGoProgrammedDirection ()
 

Detailed Description

Provides a post API class for sending commands directly to the simulation.

Member Function Documentation

◆ moveToTargetInMachineCoords()

moveToTargetInMachineCoords ( )

Do a move to the target in machine coordinates.

Calling this will also reset the target automatically, so you must build up a new target.

◆ moveToTargetInWorkCoords()

moveToTargetInWorkCoords ( )

Do a move to the target in work coordinates (ie. the post coordinates).

Calling this will also reset the target automatically, so you must build up a new target.

◆ performToolChangeCycle()

performToolChangeCycle ( )

Perform a tool change.

◆ resetTarget()

resetTarget ( )

Reset the target coordinates ie. clears the current target(s).

◆ retractAlongToolAxisToLimit()

retractAlongToolAxisToLimit ( )

Do a rapid retract move along the tool axis until the machine reaches a configured limit.

◆ setFeedrate()

setFeedrate ( Number  feedrate)

Set the feedrate to a specific value.

This setting is modal and does not get reset with the moveToTarget calls from above.

◆ setFeedrateToMax()

setFeedrateToMax ( )

Set the feedrate to max.

This setting is modal and does not get reset with the moveToTarget calls from above.

◆ setMotionToLinear()

setMotionToLinear ( )

Set the motion mode to linear (ie. G01 style movement).

This setting is modal and does not get reset with the moveToTarget calls from above.

◆ setMotionToRapid()

setMotionToRapid ( )

Set the motion mode to Rapid (ie. G00 style movement).

This setting is modal and does not get reset with the moveToTarget calls from above.

◆ setRotaryToGoProgrammedDirection()

setRotaryToGoProgrammedDirection ( )

The axis will go in direction of the signed difference.

◆ setRotaryToGoShortestDirection()

setRotaryToGoShortestDirection ( )

Any rotary movement will go the shortest direction.

◆ setTarget()

setTarget ( Axis  axis,
Number  axisPosition 
)

Set the target from an axis.

◆ setTargetA()

setTargetA ( Number  a)

Set Target A

◆ setTargetB()

setTargetB ( Number  b)

Set Target B

◆ setTargetC()

setTargetC ( Number  c)

Set Target C

◆ setTargetForCoordinate()

setTargetForCoordinate ( Integer  coordinate,
Number  axisPosition 
)

Set the target from the rotary axis coordinate. coordinate 0=A, 1=B, 2=C. Values are in radians.

◆ setTargetForId()

setTargetForId ( MachineConfiguration::AxisId  axisId,
Number  axisPosition 
)

Set the target from an axis ID. If the id is ABC, the value will be in radians.

◆ setTargetX()

setTargetX ( Number  x)

Set Target X

◆ setTargetY()

setTargetY ( Number  y)

Set Target Y

◆ setTargetZ()

setTargetZ ( Number  z)

Set Target Z

◆ setTCPModeOff()

setTCPModeOff ( )

Turn the TCP mode OFF.

◆ setTCPModeOn()

setTCPModeOn ( )

Turn the TCP mode ON.

◆ setTWPModeAlignToCurrentPose()

setTWPModeAlignToCurrentPose ( )

Turn the Tilted Work Plane (TWP) mode ON and align the work plane to the current pose of the machine. This emulates a typical "dynamic work offset" command where the user doesn't set the tilted work plane rotations directly. The machine MUST be rotated into position before activating this function.

◆ setTWPModeByEulerAngles()

setTWPModeByEulerAngles ( Integer  eulerConvention,
Number  angle1,
Number  angle2,
Number  angle3 
)

Turn the Tilted Work Plane (TWP) mode ON and set the work plane by rotations using euler angles following the passed in Euler Convention. All angles are measured in radians and the rotations follow the right hand rule. The Euler Convention should be the same as used in the Matrix::getEuler2 function.

The possible Euler conventions are defined in the builtin.cps and take the form of EULER_<order>_<type> where <order> is the order the three rotations are performed in and <type> is either R for body convention and S for world convention.

Example: Euler Convention = EULER_ZXZ_R

  • Step 1: rotation about the Z axis by angle 1
  • Step 2: rotation about the new X axis by angle 2
  • Step 3: rotation about the new Z axis by angle 3

All angles are measured in radians and the rotations follow the right hand rule. This command can be called before the machine rotation is performed, as the resulting transformed coordinate system is independent of the machine pose.

◆ setTWPModeBySpatialAngles()

setTWPModeBySpatialAngles ( Number  angleA,
Number  angleB,
Number  angleC 
)

Turn the Tilted Work Plane (TWP) mode ON and set the work plane orientation by rotations using spatial angles. Spatial Angles are always applied in this order:

Step 1: rotation about the Z axis by angle C Step 2: rotation about the new Y axis by angle B Step 3: rotation about the new X axis by angle A

All angles are measured in radians and the rotations follow the right hand rule. This command can be called before the machine rotation is performed, as the resulting transformed coordinate system is independent of the machine pose.

◆ setTWPModeOff()

setTWPModeOff ( )

Turn the TWP mode OFF.



Generated by Autodesk, Inc. 31 January 2025
Copyright (c) 2012-2025 by Autodesk, Inc.