yanghc 发表于 2007-10-21 11:41:00

小的编程帮助

<p>在CAD中提取一个层进行操作用LISP如何编程?</p><p>谢谢指教</p><p>刚学LISP中</p><p></p>

xgr 发表于 2007-10-21 17:41:00

<p>1 查找图层,如果为NIL,则创建图层;</p><p>(if (= (tblobjname "layer" "XXX") nil)<br/>&nbsp;(progn<br/>&nbsp;&nbsp; (command "layer" "n" "XXX" "C" "1" "XXX" "")<br/>&nbsp;)<br/>)</p><p>2 设置系统变量,使XXX层为当前层;</p><p>(setvar "clayer" "XXX")</p><p>3 用entmake函数在XXX层上创建实体;</p><p>(entmake (list (cons 0 "Text")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 100 "AcDbEntity")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 8 "XXX")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 100 "AcDbText")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 7 "hz")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 1 m)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 40 wzch)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 41 1)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 50 lx)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 410 "model")<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 71 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 72 4)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 73 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 10&nbsp;P1)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (cons 11 P2)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; )</p>
页: [1]
查看完整版本: 小的编程帮助