GetVariable 方法 (ActiveX) 
获取 AutoCAD 系统变量的当前设置。 支持的平台:仅限 Windows 签名VBA: RetVal = object.GetVariable(Name) 
 返回值 (RetVal)类型:变体 指定系统变量的值。 言论有关所有AutoCAD系统变量及其类型的列表,请参见AutoCAD帮助系统中的“系统变量”。 例子VBA: 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
可视化 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-11-4 19:35
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.