LocalDef函数
用于返回本地坐标系的设置状态。
格式
LocalDef (本地坐标系编号)
参数
- 本地坐标系编号
- 指定返回状态的本地坐标系编号(1~15的整数)。
返回值
如果已设置指定的本地坐标系,则返回“True”;如果未设置,则返回“False”。
参阅
Arm、ArmClr、ArmSet、ECPSet、Local、LocalClr、Tool、TLClr、TLSet
LocalDef函数使用示例
- 代码部分
Function DisplayLocalDef(localNum As Integer)
' Function to display the definition status and values of a local coordinate system
' Parameter: localNum - Local coordinate system number (1-15)
' If the local coordinate system is defined, displays its values
' If not defined, displays a message indicating it is not defined
' If the input number is outside the valid range, displays an error message
' Validate input range (1-15)
If localNum < 1 Or localNum > 15 Then
' Display error message for invalid range
Print "Please enter a value for defined Local coordinate system from 1 to 15"
Exit Function
EndIf
' Check if the local coordinate system is defined and display appropriate message
If LocalDef(localNum) = False Then
' Display message when not defined
Print "Local " + Str$(localNum) + " is not defined"
Else
' Display local coordinate system number and values when defined
Print "Local " + Str$(localNum) + ":"
Print Local(localNum)
EndIf
Fend
- 前提: Local设置
- Local 1: X: -300.000 Y: 250.000 Z: -100.000 U: 45.000 V: 0.000 W: 0.000 /R /0
- Local 2: 未定义
- 输入输出
- X: -300.000 Y: 250.000 Z: -100.000 U: 45.000 V: 0.000 W: 0.000 /R /0
- Local 2 is not defined
- Please enter a value for defined Local coordinate system from 1 to 15
1 >
Local 1:
2 >
16(范围外) >