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(範囲外) >