在大多数情况下,在我看来使用Visual LISP更方便,但我可以使用和DXF代码。下面是一个没有Visual LISP的程序示例:
- (defun c:lxplode2(/ cSel eEnt cLay lEnt cDxf nDxf)
- (if(setq cSel(entsel "\nSelect entity to explode: "))
- (progn
- (setq eEnt(car cSel)
- cLay(cdr(assoc 8(entget eEnt)))
- lEnt(entlast)); end setq
- (if(and
- (vl-cmdf "_.explode" eEnt)
- (not(equal lEnt(entlast)))
- ); end and
- (progn
- (while(setq lEnt(entnext lEnt))
- (setq cDxf(entget lEnt)
- nDxf(subst(cons 8 cLay)(assoc 8 cDxf)cDxf))
- (entmod nDxf)
- ); end while
- (princ (strcat "\nEntities exploded onto layer " cLay "."))
- ); end progn
- (princ "\n<!> Can't explode this entity <!> ")
- ); end if
- ); end progn
- ); end if
- (princ)
- ); end of c:lxplode2
我认为学习Visual LISP对你来说只是时间问题。说实话,您首先学习常用的AutoLISP是非常好的,因为它是知识的基础,没有它,Visual LISP就不会给您带来很大的优势。 |