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: 未定義
輸入輸出

1 >
Local 1:

X: -300.000 Y: 250.000 Z: -100.000 U: 45.000 V: 0.000 W: 0.000 /R /0

2 >

Local 2 is not defined

16(範圍外) >

Please enter a value for defined Local coordinate system from 1 to 15