- UID
- 82552
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-9-27
- 最后登录
- 1970-1-1
|
发表于 2004-5-14 13:28:21
|
显示全部楼层
对不起 - 没有匹配记录. 请用不同的条件再试.
kLoadDwgMsg and acedCommand()
The acedCommand() works in two basic contexts: when operating on the RQXLOAD and RQSUBR request codes. In ObjectARX, however, it does not work for the ObjectARX application message AcRx::kLoadDwgMsg, which is the ObjectARX equivalent of RQXLOAD. It works fine for the message AcRx::kInvkSubr, which is equivalent to RQSUBR.
It is important to many applications to execute a few AutoCAD commands at the beginning of every drawing edit session. This can be accomplished by queuing up AutoLISP expressions, including use of the (command) function, using ads_queueexpr(), for execution during the edit session initialization, after (s::startup) has been executed.
Note that the queued expressions are not executed during the call to ads_queueexpr(). They will occur after your application has returned from its kLoadDwgMsg message invocation of acrxEntryPoint().
When using ads_queueexpr(), the entered string must be fully expanded, with outer parentheses. Whatever was previously passed in as resbuf chains must be converted to ASCII to use this mechanism.
Multiple calls to ads_queueexpr() from the kLoadDwgMsg callback are perfectly acceptable. They get queued up in the order of the calls.
Do not use ads_queueexpr() in any other context. To do so will have unpredictable results, and may even be damaging, because the queue may not be looked at until active AutoLISP evaluations, MENU items, and/or SCRIPT executions are all quiescent. Use this function sparingly, as it will be removed as soon as the original design can be implemented.
=======================================================
It's not declared in any ObjectARX headers, so you have to declare it
locally:
extern "C" int ads_queueexpr( char* lisp_expr );
void SomeFunction()
{
char* pszLispExpression = GetLispExpression();
//i.e. '(arxunload "myarx.arx")'
ads_queueexpr( pszLispExpression );
} |
|