MAL.AngleOptions |
options = MAL.AngleOptions( [BYVAL nUnits AS INTEGER=ML_DEGREES], [BYVAL nRange AS INTEGER=ML_RANGE_180], [BYVAL n3DPlanes AS INTEGER=ML_3D_SPACE], [BYVAL n2DAngleType AS INTEGER=ML_ANGLE_NORMAL], [BYVAL nAxis AS INTEGER=ML_AXIS_X] ) AS HANDLE
options = MAL.AngleOptions( [BYVAL nUnits AS INTEGER=ML_DEGREES], [BYVAL nRange AS INTEGER=ML_RANGE_360], [BYVAL n3DPlanes AS INTEGER=ML_2D_PLANE], [BYVAL n2DAngleType AS INTEGER=ML_ANGLE_NORMAL], [BYVAL nAxis AS INTEGER=ML_AXIS_X] ) AS HANDLE
option = MAL.AngleOptions( BYVAL hOptions AS HANDLE, BYVAL nOptionToGet AS INTEGER ) AS INTEGER
caption = MAL.AngleOptions( BYVAL hOptions AS HANDLE, [BYVAL nDataType AS INTEGER=ML_VOID] ) AS STRING
Returns the Angle Options handle for the available angle options. The first format is the defaults for 3D angles and the second format is the defaults for 2D angles. The type of angle is determined by the data type of the supplied arrays (last dimension). This can be overridden if 3D data by the n3DPlanes parameter.
The third syntax returns a specific option from the options handle as an INTEGER. The options are defined usiing CONST as listed below.
The forth syntax returns a string containing the properties of current angle. This can be used as a caption in graphs etc.
The following constants can be used
' Angle and Rotation Units CONST ML_RADIANS = 0 ' Use Radians as Angle Units CONST ML_DEGREES = 1 ' Use Degrees as Angle Units CONST ML_GRADIAN = 2 ' Use Gradian as Angle Units
' Angle Degree Range CONST ML_RANGE_180 = 0 ' +/- 180 Degrees CONST ML_RANGE_360 = 1 ' 0-360 Degrees
' 3D Planes CONST ML_3D_SPACE = 0x00 ' This is same as 3D space/No Plane CONST ML_XY_PLANE = 0x01 ' XY Plane = Top View CONST ML_YZ_PLANE = 0x02 ' YZ Plane = Side View CONST ML_XZ_PLANE = 0x03 ' XZ Plane = Front View CONST ML_2D_PLANE = 0x08 ' Default 2D or Project into 2D Plane
' 2D Angle Types CONST ML_ANGLE_NORMAL = 0 ' Vector vs Vector Angle CONST ML_ANGLE_VSAXIS = 1 ' Vector vs 2D Axis
' 2D/3D Axis CONST ML_AXIS_X = 0 ' X Axis CONST ML_AXIS_Y = 1 ' Y Axis CONST ML_AXIS_Z = 2 ' Z Axis
' Angle Options Get Options Identifier CONST MA_ANGOPT_GETCAPTION = 0x00000000 ' Get Caption. Add ML_2D or ML_3D for data type CONST MA_ANGOPT_GETCAPTION2D = 0x00000002 ' Get Caption with 2D Data Type CONST MA_ANGOPT_GETCAPTION3D = 0x00000003 ' Get Caption with 3D Data Type CONST MA_ANGOPT_GETUNITS = 0x00010000 ' Get Angle Units CONST MA_ANGOPT_GETRANGE = 0x00020000 ' Get Angle Range CONST MA_ANGOPT_GET2DAXIS = 0x00030000 ' Get Axis of 2D Angle vs Plane CONST MA_ANGOPT_GET2DVSPLANE = 0x00040000 ' Get 2D Angle vs Plane flag CONST MA_ANGOPT_GET3DOPTIONS = 0x00050000 ' Get 3D Angle Projection option CONST MA_ANGOPT_GETPROJECT2D = 0x00060000 ' Get 3D Angle with 3D Vector Projected into 2D Plane flag
Example:
DIM hOptions AS HANDLE
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 2D Angle 0-360 Degrees (Default 2D) hOptions = MAL.AngleOptions() PRINT MAL.AngleOptions( hOptions, ML_2D ),
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 3D Angle +/- 180 Degrees (Default 3D) hOptions = MAL.AngleOptions() PRINT MAL.AngleOptions( hOptions, ML_3D ),,
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 2D Angle 0-360 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_360,_ ML_2D_PLANE,_ ML_ANGLE_NORMAL ) PRINT MAL.AngleOptions( hOptions, ML_2D ),
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 2D Angle vs Y Axis 0-360 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_360,_ ML_2D_PLANE,_ ML_ANGLE_VSAXIS,_ ML_AXIS_Y ) PRINT MAL.AngleOptions( hOptions, ML_2D ),,
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' 3D Angle +/- 180 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_180,_ ML_3D_SPACE ) PRINT MAL.AngleOptions( hOptions, ML_3D ),
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Projected 2D Angle in the XZ Plane 0-360 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_360,_ ML_XZ_PLANE ) PRINT MAL.AngleOptions( hOptions, ML_3D ),
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Projected 2D Angle in the XZ Plane vs X Axis 0-360 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_360,_ ML_XZ_PLANE,_ ML_ANGLE_VSAXIS,_ ML_AXIS_X ) PRINT MAL.AngleOptions( hOptions, ML_3D ),
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Projected 3D Angle in the XZ Plane +/- 180 Degrees hOptions = MAL.AngleOptions( ML_DEGREES,_ ML_RANGE_180,_ ML_XZ_PLANE+ML_2D_PLANE ) PRINT MAL.AngleOptions( hOptions, ML_3D ),,
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' This is the output on the Console when running: '
2D Angle 0-360 Degrees (Default 2D) 3D Angle +/- 180 Degrees (Default 3D)
2D Angle 0-360 Degrees 2D Angle vs Y Axis 0-360 Degrees
3D Angle +/- 180 Degrees Projected 2D Angle in the XZ Plane 0-360 Degrees Projected 2D Angle in the XZ Plane vs X Axis 0-360 Degrees Projected 3D Angle in the XZ Plane +/- 180 Degrees
|