CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetVariable Method (ActiveX)

2023-1-4 06:28| 发布者: admin| 查看: 2381| 评论: 0|来自: AutoCAD

摘要: 获取 AutoCAD 系统变量的当前设置。

获取 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)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 01:56

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部