确定符号名称是可以包含扩展字符集还是超过 31 个字符。 支持的平台:仅窗口 属性值只读:不 类型:布尔
言论此属性的初始值为。True 扩展符号名称最多可以包含 255 个字符和 A-Z、0-9、空格以及 Microsoft Windows 和 AutoCAD 未用于其他目的的任何特殊字符。 受限符号名称最多可包含 31 个字符和 A-Z、0-9、美元符号 ($)、下划线 (_) 和连字符 (-)。 此属性适用于存储在符号表中的非图形对象(例如线型和图层)的名称。 注意:此属性的值存储在 EXTNAMES 系统变量中。
例子工 务 局: Sub Example_AllowLongSymbolNames()
' This example reads and modifies the preference value that controls
' whether symbol names include extended character sets or more
' than 31 characters.
'
' When finished, this example resets the preference value back to
' its original value.
Dim ACADPref As AcadDatabasePreferences
Dim originalValue As Variant, newValue As Variant
' Get the user preferences object
Set ACADPref = ThisDrawing.preferences
' Read and display the original value
originalValue = ACADPref.AllowLongSymbolNames
MsgBox "The AllowLongSymbolNames preference is set to: " & originalValue
' Modify the AllowLongSymbolNames preference by toggling the value
ACADPref.AllowLongSymbolNames = Not (ACADPref.AllowLongSymbolNames)
newValue = ACADPref.AllowLongSymbolNames
MsgBox "The AllowLongSymbolNames preference has been set to: " & newValue
' Reset the preference back to its original value
'
' * Note: Comment out this last section to leave the change to
' this preference in effect
ACADPref.AllowLongSymbolNames = originalValue
MsgBox "The AllowLongSymbolNames preference was reset back to: " & originalValue
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_AllowLongSymbolNames()
;; This example reads and modifies the preference value that controls
;; whether symbol names include extended character sets or more
;; than 31 characters.
;;
;; When finished, this example resets the preference value back to
;; its original value.
(setq acadObj (vlax-get-acad-object))
;; Get the drafting preferences object
(setq ACADPref (vla-get-Preferences doc))
;; Read and display the original value
(setq originalValue (vla-get-AllowLongSymbolNames ACADPref))
(alert (strcat "The AllowLongSymbolNames preference is set to: " (if (= originalValue :vlax-true) "1" "0")))
;; Modify the AllowLongSymbolNames preference by toggling the value
(vla-put-AllowLongSymbolNames ACADPref (if (= originalValue :vlax-true) :vlax-false :vlax-true))
(setq newValue (vla-get-AllowLongSymbolNames ACADPref))
(alert (strcat "The AllowLongSymbolNames preference has been set to: " (if (= newValue :vlax-true) "1" "0")))
;; Reset the preference back to its original value
;;
;; * Note: Comment out this last section to leave the change to
;; this preference in effect
(vla-put-AllowLongSymbolNames ACADPref originalValue)
(alert (strcat "The AllowLongSymbolNames preference was reset back to: " (if (= originalValue :vlax-true) "1" "0")))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 08:50
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.