找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1385|回复: 4

[ARX程序]:在Arx中如何使用ads_command()函数?

[复制链接]
发表于 2002-9-26 17:08:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
将面face旋转,这样做如何?
ads_command(RTSTR,"rotate3D",RTSTR,"face",RTSTR,"",RTSHORT,
2,RTPOINT,pt1,RTPOINT,pt2,RTREAL,angle,RTNONE);
  其中:pt1,pt2为旋转轴,angle为旋转角度。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-9-26 17:14:13 | 显示全部楼层

Re: [ARX程序]:在Arx中如何使用ads_command()函数?

最初由 sitrxs 发布
[B]将面face旋转,这样做如何?
ads_command(RTSTR,"rotate3D",RTSTR,"face",RTSTR,"",RTSHORT,
2,RTPOINT,pt1,RTPOINT,pt2,RTREAL,angle,RTNONE);
  其中:pt1,pt2为旋转轴,angle为旋转角度。 [/B]


在ARX里面,你应该使用:

AcGeMatrix3d类的AcGeMatrix3d::setToRotation构造旋转变换矩阵,然后使用实体的:AcDbEntity::transForm对实体进行变换。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2002-9-27 10:09:42 | 显示全部楼层
用ads_command()都能用吗?有的时候不能用,但编译无错,
为什么??
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-9-27 10:22:43 | 显示全部楼层
最初由 jxxjian 发布
[B]用ads_command()都能用吗?有的时候不能用,但编译无错,
为什么?? [/B]


必须是内部命令。一些自己定义的C:这样的,不能在COMMAND里面用。

编译通过,只是你写的ADS_COMMAND里面参数格式对,编译器不知道这个命令是否是内部的。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-9-27 18:32:25 | 显示全部楼层

贴篇资料,关于如何在ARX里面使用ads_command()


  1. [FONT=courier new]
  2. Using ads_command() and ads_invoke() in ARX
  3. ID 1945
  4. Applies to: AutoCAD
  5. AutoCAD 2000I
  6. AutoCAD R14

  7. Question
  8. I encountered some problems when using ads_command or ads_invoke() from an ARX
  9. command or from within the acrxEntryPoint() function. Why ?
  10. Answer
  11. ads_command() works in two basic contexts in ADS: when operating on the RQXLOAD
  12. and RQSUBR request codes. In ARX however, it is not working for the ARX app
  13. message AcRx::kLoadDwgMsg, which is the ARX equivalent of RQXLOAD. It works fine
  14. for the message AcRx::kInvkSubr, which is equivalent to RQSUBR.

  15. kLoadDwgMsg workaround: 'int ads_queueexpr(char* lisp_expr);'

  16. Since it is important to many applications to be able to execute a few AutoCAD
  17. commands at the beginning of every drawing edit session, this can be
  18. accomplished by queuing up LISP expressions, including use of the (COMMAND)
  19. function, using ads_queueexpr(), for execution during the edit session
  20. initialization, after (S::STARTUP) has been executed.

  21. Note that the queued expressions are *not* executed during the call to
  22. ads_queueexpr(); they will occur after your application has returned from its
  23. kLoadDwgMsg message invocation of acrxEntryPoint(). When using ads_queueexpr(),
  24. the entered string must be fully expanded and with outer parentheses. Whatever
  25. was previously passed in as resbuf chains must be converted to ASCII to use this
  26. mechanism. Multiple calls to ads_queueexpr() from the kLoadDwgMsg callback is
  27. acceptable because they are queued up in the order of the calls.


  28. extern "C" void ads_queueexpr (char *) ;

  29. void MyArxFunc () {
  30. //----- Here I should better not use ads_command()
  31. }

  32. int MyFunc () {
  33. //----- Here I can use ads_command()
  34. }

  35. extern "C" AcRx::AppRetCode acrxEntryPoint (AcRx::AppMsgCode msg, void *p) {
  36. switch ( msg ) {
  37. case AcRx::kInitAppMsg:
  38. acrxUnlockApplication (p) ;
  39. acedRegCmds->addCommand ("TEST_GROUP", "MyArxFunc",
  40. "MyArxFunc", ACRX_CMD_MODAL, MyArxFunc) ;
  41. // ...
  42. break ;
  43. case AcRx::kUnloadAppMsg:
  44. acedRegCmds->removeGroup ("TEST_GROUP") ;
  45. // ...
  46. break ;
  47. case AcRx::kLoadDwgMsg:
  48. ads_defun ("C:MYFUNC", 0) ;
  49. //----- Here I can use ads_command(), instead use
  50. ads_queueexpr()
  51. ads_queueexpr ("(command "line" "0,0,0" "10,10,0"
  52. "")") ;
  53. break ;
  54. case AcRx::kInvkSubrMsg:
  55. if ( ads_getfuncode () == 0 )
  56. MyFunc () ;
  57. break ;
  58. }
  59. return (AcRx::kRetOK) ;
  60. }

  61. [/FONT]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-22 23:12 , Processed in 0.351089 second(s), 39 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表