找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 483|回复: 6

[ARX程序]:怎样用命令在ARX程序中加载另一个ARX程序?

[复制链接]
发表于 2004-5-16 20:48:24 | 显示全部楼层 |阅读模式

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

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

×
怎样用命令在ARX程序中加载另一个ARX程序?
高手帮忙给个函数,怎么写?谢谢!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-5-16 20:50:15 | 显示全部楼层
调用arx命令。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-5-16 21:43:26 | 显示全部楼层
acedArxLoad ( "app");       ----    Load your app.arx
acedArxUnload("app"); -   ----    Unload your app.arx
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-5-17 08:01:51 | 显示全部楼层
acedArxLoad ( "app"); ---- Load your app.arx
acedArxUnload("app"); - ---- Unload your app.arx
app是arx文件的路径?
acedArxLoad ( "../a.arx");
acedArxLoad ( "c:\a.arx");
我都试过了 都不能加载程序????!!!!

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

使用道具 举报

发表于 2004-5-17 11:12:34 | 显示全部楼层
使用以下函数
acedArxLoad ( "app"); ---- Load your app.arx
acedArxUnload("app"); - ---- Unload your app.arx
其中app是你的arx文件名
但是你应该设AUTOCAD的环境变量中的搜索路径
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-5-17 20:28:37 | 显示全部楼层
acedArxLoad ( "../a.arx");      ?[/COLOR]
acedArxLoad ( "c:\a.arx");     Error![/COLOR]
------------------------------------------------------

acedArxLoad ("c:/myDir/a.arx");
acedArxLoad ("c:/myDir/a");
acedArxLoad ("c:\\myDir\\a.arx");
acedArxLoad ("c:\\myDir\\a");
  all  OK.[/COLOR]

如果 设置了 AUTOCAD的环境变量中的搜索路径 C:\myDir, 你可以简单如下:
acedArxLoad ("a");

acedArxLoad("a.arx");

======================================
acedCommend("") 是不是直接调用命令?
Look below   (From ArxDoc)


  1.   AutoCAD Queries and Commands      

  2. General Access  


  3. The most general of the functions that access AutoCAD are
  4. acedCommand() and acedCmd(). Like the (command) function in
  5. AutoLISP, these functions send commands and other input directly to the
  6. AutoCAD Command prompt.

  7. int
  8. acedCommand(int rtype, ...);

  9. int
  10. acedCmd(const struct resbuf * rbp);

  11. Unlike most other AutoCAD interaction functions, acedCommand() has a
  12. variable-length argument list: arguments to acedCommand() are treated as
  13. pairs except for RTLE and RTLB, which are needed to pass a pick point.
  14. The first of each argument pair identifies the result type of the argument
  15. that follows, and the second contains the actual data. The final argument
  16. in the list is a single argument whose value is either 0 or RTNONE.
  17. Typically, the first argument to acedCommand() is the type code RTSTR,
  18. and the second data argument is a string that is the name of the
  19. command to invoke. Succeeding argument pairs specify options or data
  20. that the specified command requires. The type codes in the
  21. acedCommand() argument list are result types.

  22. The data arguments must correspond to the data types and values
  23. expected by that command's prompt sequence. These can be strings,
  24. real values, integers, points, entity names, or selection set names. Data
  25. such as angles, distances, and points can be passed either as strings (as
  26. the user might enter them) or as the values themselves (that is, as integer,
  27. real, or point values). An empty string ("") is equivalent to entering a
  28. space on the keyboard.

  29. Because of the type identifiers, the acedCommand() argument list is not
  30. the same as the argument list for the AutoLISP® (command) routine.
  31. Be aware of this if you convert an AutoLISP routine into an
  32. ObjectARX® application.

  33. There are restrictions on the commands that acedCommand() can invoke,
  34. which are comparable to the restrictions on the AutoLISP (command)
  35. function.

  36. Note  The acedCommand() and acedCmd() functions can invoke the
  37. AutoCAD SAVE or SAVEAS command. When they do so, AutoLISP
  38. issues a kSaveMsg message to all other ObjectARX applications currently
  39. loaded, but not to the application that invoked SAVE. The comparable
  40. code is sent when these functions invoke NEW, OPEN, END, or QUIT
  41. from an application.
  42. The following sample function shows a few calls to acedCommand().

  43. int docmd()
  44. {
  45.     ads_point p1;
  46.     ads_real rad;

  47.     if (acedCommand(RTSTR, "circle", RTSTR, "0,0", RTSTR,
  48.         "3,3", 0) != RTNORM)
  49.         return BAD;
  50.     if (acedCommand(RTSTR, "setvar", RTSTR, "thickness",
  51.         RTSHORT, 1, 0) != RTNORM)
  52.         return BAD;

  53.     p1[X] = 1.0; p1[Y] = 1.0; p1[Z] = 3.0;
  54.     rad = 4.5;

  55.     if (acedCommand(RTSTR, "circle", RT3DPOINT, p1, RTREAL,
  56.         rad, 0) != RTNORM)
  57.         return BAD;

  58.     return GOOD;
  59. }
  60. Provided that AutoCAD is at the Command prompt when this function is
  61. called, AutoCAD performs the following actions:

  62. Draws a circle that passes through (3.0,3.0) and whose center is at(0.0,0.0).
  63. Changes the current thickness to 1.0. Note that the first call to
  64. acedCommand() passes the points as strings, while the second passes a
  65. short integer. Either method is possible.
  66. Draws another (extruded) circle whose center is at (1.0,1.0,3.0) and
  67. whose radius is 4.5. This last call to acedCommand() uses a 3D point and
  68. a real (double-precision floating-point) value. Note that points are passed
  69. by reference, because ads_point is an array type.
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-6-29 16:09:27 | 显示全部楼层

该多学学基础的东西了

最初由 frankzht 发布
[B]acedArxLoad ( "app"); ---- Load your app.arx
acedArxUnload("app"); - ---- Unload your app.arx
app是arx文件的路径?
acedArxLoad ( "../a.arx");
acedArxLoad ( "c:\a.arx");
我都试过了 都不能加载程序... [/B]


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-21 19:43 , Processed in 0.317885 second(s), 42 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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