CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

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

2023-1-1 15:47| 发布者: admin| 查看: 529| 评论: 0|来自: AutoCAD

应用程序对象提供了用于设置和检索 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 )

GMT+8, 2024-5-19 13:58

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部