CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2021 开发者帮助

设置和返回系统变量 (.NET)

2024-5-18 18:36| 发布者: admin| 查看: 94| 评论: 0|原作者: admin|来自: AutoCAD

设置和返回系统变量 (.NET)

Application 对象提供了用于设置和检索 AutoCAD 系统变量的 and 方法。例如,若要将整数分配给 MAXSORT 系统变量,请使用以下代码:SetSystemVariableGetSystemVariable

VB.NET

'' Get the current value from a system variable
Dim nMaxSort as Integer = Application.GetSystemVariable("MAXSORT")
 
'' Set system variable to new value
Application.SetSystemVariable("MAXSORT", 100)

C#

// Get the current value from a system variable
int nMaxSort = System.Convert.ToInt32(Application.GetSystemVariable("MAXSORT"));
 
// Set system variable to new value
Application.SetSystemVariable("MAXSORT", 100);

VBA/ActiveX 代码参考

'' Get the current value from a system variable
Dim nMaxSort as Integer
nMaxSort = ThisDrawing.GetVariable("MAXSORT")
 
'' Set system variable to new value
ThisDrawing.SetVariable "MAXSORT", 100

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 13:07

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部