02-06 控制AutoCAD环境(六) 设置和返回系统变量

 Set and Return System Variables

设置和返回系统变量

The Application object provides the SetSystemVariable and GetSystemVariable methods for setting and retrieving AutoCAD system variables. For example, to assign an integer to the MAXSORT system variable, use the following code:

Application对象提供了SetSystemVariable方法和GetSystemVariable方法来设置和提取系统变量。例如,下例代码将一个整数赋值给系统变量MAXSORT:

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 Code Reference

 '' 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

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值