- UID
- 1
- 积分
- 16111
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
发表于 2002-4-13 00:32:25
|
显示全部楼层
可以,写ADSRX的程序,既通过ADS_DEFUN来定义外部函数(命令)中,通过ads_putsym,见下面:
int
acedPutSym(
const char* sname,
struct resbuf* value);
Include File
acedads.h
Sets the value of an AutoLISP symbol.
Warning This command can be used in the ARX program environment only when AutoCAD sends the message kInvkSubrMsg to the application.
The sname argument specifies the symbol name. The value argument is a pointer to a result-buffer list that specifies the value of the symbol. The list must contain values of types that can be represented in AutoLISP; if it doesn't, the acedPutSym() call fails. To set the value of the AutoLISP symbol to nil, make the following assignment:
value->restype = RTNIL;
If sname is not the name of a current symbol, acedPutSym() creates a new AutoLISP symbol with this name and assigns it the value.
Note An acedPutSym() function call can create a new AutoLISP symbol that AutoLISP cannot access--for example, by including illegal characters in the symbol name, such as "pair(s". An acedGetSym() call can access such symbols, but they will cause an error in a future upgrade or release of AutoCAD. Your programs should not rely on this capability.
The acedPutSym() function returns RTNORM if it succeeds; otherwise, it returns RTERROR. When acedPutSym() fails, it sets the system variable ERRNO to a value that indicates the reason for the failure. |
|