获取 AutoCAD 系统变量的当前设置。 支持的平台:仅窗口 签名工 务 局: RetVal = object.GetVariable(Name)
返回值(RetVal)类型:变体 指定系统变量的值。 言论有关所有 AutoCAD 系统变量及其类型的列表,请参阅 AutoCAD 帮助系统中的“系统变量”。 例子工 务 局: Sub Example_GetVariable()
' This example finds the current setting of the
' system variable FILLMODE.
Dim sysVarName As String
Dim varData As Variant
sysVarName = "FILLMODE"
varData = ThisDrawing.GetVariable(sysVarName)
MsgBox sysVarName & " = " & varData, , "GetVariable Example"
End Sub
Visual LISP: (vl-load-com)
(defun c:Example_GetVariable()
;; This example finds the current setting of the
;; system variable FILLMODE.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq sysVarName "FILLMODE")
(setq varData (vlax-variant-value (vla-GetVariable doc sysVarName)))
(alert (strcat sysVarName " = " (itoa varData)))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 08:43
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.