AutoCAD自动加载ARX文件
我们以格式刷(matchprop)命令为例教大家如何解决这种问题
1.首先找到AUTOCAD根目录下面的Acad.lsp这个文件,然后在适当的位置加上如下代码:
(load "shaobotao")一般在文件开头附近找个地方加进去就行。
Load函数是用来装载CAD的lsp程序文件,双引号之中是引用的lsp文件的文件名,注意代码包含括号。
这样当AUTOCAD运行的时候,首先会装入Acad.lsp这个文件,只要执行到这一行代码时便会自动加载我们所编写的lsp文件。
2.然后我们来编写程序文件,对应上面我们程序文件的名称应该为shaobotao.lsp
shaobotao.lsp这个文件里面的加载代码。
//===== shaobotao =====
(arxload "match")
//=====end shaobotao=======
上面代码打开记事本写入就行,保存为shaobotao.lsp即可,当然这个文件名你可以随便起,但是要与第一步中的Load函数后面加载的文件名相同。
这样CAD启动时候就会进入我们的shaobotao.lsp中执行里面的加载命令 (arxload "match")了
shaobotao.lsp部分代码(当然你可以按照这种格式再添加)
//
===== shaobotao =====
(autoxload " hpmplot " ' ("hpconfig" "hpconfig" ))
;;; ========= AutoArxLoad OCE Driver ARX applications ===========
(autoarxload " oceconf " ' ("oceconfig" "oceconfig"))
;;; ===== AutoArxLoad Arx Applications =====
(autoarxload " geomcal " ' ("cal" "cal"))
(autoarxload " geom3d " ' ("mirror3d" "rotate3d" "align"
" mirror3d " " rotate3d "
" align " ))
(arxload " acadapp " )
(arxload " match " )
(arxload " acadps " )
(arxload " acmted " )
// =====end shaobotao=======
(autoxload " hpmplot " ' ("hpconfig" "hpconfig" ))
;;; ========= AutoArxLoad OCE Driver ARX applications ===========
(autoarxload " oceconf " ' ("oceconfig" "oceconfig"))
;;; ===== AutoArxLoad Arx Applications =====
(autoarxload " geomcal " ' ("cal" "cal"))
(autoarxload " geom3d " ' ("mirror3d" "rotate3d" "align"
" mirror3d " " rotate3d "
" align " ))
(arxload " acadapp " )
(arxload " match " )
(arxload " acadps " )
(arxload " acmted " )
// =====end shaobotao=======