cnks
发表于 2011-11-17 23:56:26
没有2004,不过看上去应该是可以的,要是有的话一定要测试一下
xiaotao
发表于 2011-11-18 02:14:59
了不起!
Gu_xl
发表于 2011-11-18 08:43:24
飞版辛苦了!2004测试成功!若再能支持2000~2002就完美了!写了个自动加载程序,程序根据cad版本自动加载飞版的arx不同版本文件!
;;;将dynarxfor2004-2006.arx等四个文件拷贝到CAD支持目录!(autoladdynarx)函数根据CAD不同版本自动加载!
(defun autoladdynarx (/ loaded fn)
(cond ((= 16 (atoi (getvar 'acadver)))
(if (not (member "dynarxfor2004-2006.arx" (arx)))
(if (setq fn (findfile "dynarxfor2004-2006.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
)
((= 17 (atoi (getvar 'acadver)))
(if (not (member "dynarxfor2007-2009.arx" (arx)))
(if (setq fn (findfile "dynarxfor2007-2009.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
)
((= 18 (atoi (getvar 'acadver)))
(if (= "x86" (getenv "PROCESSOR_ARCHITECTURE"))
(if (not (member "dynarxfor2010-2012x32.arx" (arx)))
(if (setq fn (findfile "dynarxfor2010-2012x32.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
(if (not (member "dynarxfor2010-2012x64.arx" (arx)))
(if (setq fn (findfile "dynarxfor2010-2012x64.arx"))
(setq loaded
(arxload (findfile "dynarxfor2010-2012x64.arx")
"1"))
(setq loaded "2")
)
)
)
)
)
(if (= "1" loaded)
(progn
(alert "dynarx加载失败!程序将退出!")
(exit)
)
(if (= "2" loaded)
(progn
(alert "未找到对应的dynarx文件!程序将退出!")
(exit)
)
(princ "dynarx成功加载!")
)
)
(princ)
)
Gu_xl
发表于 2011-11-18 09:44:40
本帖最后由 Gu_xl 于 2011-11-18 09:45 编辑
Gu_xl 发表于 2011-11-18 08:43 http://bbs.mjtd.com/static/image/common/back.gif
飞版辛苦了!2004测试成功!若再能支持2000~2002就完美了!写了个自动加载程序,程序根据cad版本自动加载飞 ...
我还发现一个问题,就是在打开cad第一次自动加载arx后接着调用(HFB_PointMonitor "InfoCallback"),不起作用,需要调调用一次(HFB_PointMonitor "InfoCallback")才起作用!以后再打开cad窗口就没问题了!原因何在?飞版帮助分析一下!再次感谢!
调用代码:
;;;cad第一次加载,命令行运行tt,(HFB_PointMonitor "InfoCallback")没起作用,需再次运行tt才行!
(defun InfoCallback (dynpt / txt lst dat)
(setq txt (vl-princ-to-string (mapcar 'rtos dynpt)))
(setq txt (strcat "\n当前点的坐标是:" txt))
(if (setq lst (nentselp dynpt))
(progn
(setq dat (entget (car lst)))
(strcat txt "\n这个图元的类型是:" (cdr (assoc 0 dat)))
)
txt
)
)
(defun c:tt(/ loaded)
(GXL-ERROR-INIT (list 'cmdecho 0))
(cond ((= 16 (atoi (getvar 'acadver)))
(if (not (member "dynarxfor2004-2006.arx" (arx)))
(if (setq fn (findfile "dynarxfor2004-2006.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
)
((= 17 (atoi (getvar 'acadver)))
(if (not (member "dynarxfor2007-2009.arx" (arx)))
(if (setq fn (findfile "dynarxfor2007-2009.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
)
((= 18 (atoi (getvar 'acadver)))
(if (= "x86" (getenv "PROCESSOR_ARCHITECTURE"))
(if (not (member "dynarxfor2010-2012x32.arx" (arx)))
(if (setq fn (findfile "dynarxfor2010-2012x32.arx"))
(setq loaded (arxload fn "1"))
(setq loaded "2")
)
)
(if (not (member "dynarxfor2010-2012x64.arx" (arx)))
(if (setq fn (findfile "dynarxfor2010-2012x64.arx"))
(setq loaded
(arxload (findfile "dynarxfor2010-2012x64.arx")
"1"))
(setq loaded "2")
)
)
)
)
)
(if (not (or (= 1 loaded) (= 2 loaded)))
(if *dynView* ;_ 储存图形浏览关闭或打开变量
(progn
(HFB_PointMonitor)
(princ "\n图形浏览关闭!")
(setq *dynView* nil)
)
(progn
(HFB_PointMonitor "InfoCallback")
(princ "\n图形浏览打开!")
(setq *dynView* t)
)
)
)
(princ)
)
kwok
发表于 2011-11-18 10:21:48
怎么没有2008的?我用的是2008bit64的.....
hhh454
发表于 2011-11-18 11:39:17
期待50楼,分享源码,学习
Gu_xl
发表于 2011-11-18 12:22:06
Gu_xl 发表于 2011-11-18 09:44 static/image/common/back.gif
我还发现一个问题,就是在打开cad第一次自动加载arx后接着调用(HFB_PointMonitor "InfoCallback"),不起 ...
添加一句(vl-acad-defun 'InfoCallback)就搞定了!谢谢飞诗指点!
13579
发表于 2011-11-18 15:00:13
可以用了。。。
flowerson
发表于 2011-11-18 15:10:24
太厉害了!要顶。尽快到50楼。
3527188
发表于 2011-11-18 19:15:24
顶到50也没用看不懂ARX
页:
1
2
3
[4]
5
6
7
8
9
10
11
12
13