本人的第一个实用性的LISP程序
<P></P><P>本人写的把所有虚线转换成黄色的虚线(但对与随层的虚线无用)</P>
<P>希望大家以后能多多指点!谢谢</P>
顶一个
<P>谢谢,自己的辛苦大家来享用,楼主,高,谢谢</P> <P><FONT face="Courier New" color=#ff0000>(</FONT><A href="http://www.mjtd.com/object/autolisp/defun.htm" target="_blank" ><FONT face="Courier New" color=blue>defun</FONT></A><FONT face="Courier New"> <FONT color=blue><B>c:H2</B></FONT><FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/47.htm" target="_blank" ><FONT face="Courier New" color=blue>/</FONT></A><FONT face="Courier New"> ss1 cc<FONT color=red>)</FONT> <BR> <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/setq.htm" target="_blank" ><FONT face="Courier New" color=blue>setq</FONT></A><FONT face="Courier New"> ss1 <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/ssget.htm" target="_blank" ><FONT face="Courier New" color=blue>ssget</FONT></A><FONT face="Courier New"> <FONT color=red>)</FONT><FONT color=red>)</FONT><BR> <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/setq.htm" target="_blank" ><FONT face="Courier New" color=blue>setq</FONT></A><FONT face="Courier New"> cc <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/acad_colordlg.htm" target="_blank" ><FONT face="Courier New" color=blue>acad_colordlg</FONT></A><FONT face="Courier New"> 2<FONT color=red>)</FONT><FONT color=red>)</FONT><BR> <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/setq.htm" target="_blank" ><FONT face="Courier New" color=blue>setq</FONT></A><FONT face="Courier New"> ss1 <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/ssget.htm" target="_blank" ><FONT face="Courier New" color=blue>ssget</FONT></A><FONT face="Courier New"> <FONT color=#ff00ff>"x"</FONT> '<FONT color=red>(</FONT><FONT color=red>(</FONT>6 . <FONT color=#ff00ff>"HIDDEN"</FONT><FONT color=red>)</FONT><FONT color=red>)</FONT><FONT color=red>)</FONT><FONT color=red>)</FONT><BR> <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/command.htm" target="_blank" ><FONT face="Courier New" color=blue>command</FONT></A><FONT face="Courier New"> <FONT color=#ff00ff>"chprop"</FONT> ss1 <FONT color=#ff00ff>""</FONT> <FONT color=#ff00ff>"c"</FONT> CC <FONT color=#ff00ff>""</FONT><FONT color=red>)</FONT><BR> <FONT color=red>(</FONT></FONT><A href="http://www.mjtd.com/object/autolisp/prin1.htm" target="_blank" ><FONT face="Courier New" color=blue>prin1</FONT></A><FONT face="Courier New"><FONT color=red>)</FONT><BR><FONT color=red>)</FONT></FONT></P><P>第一个SSGET有什么用?</P> 高,谢谢 <P>谢谢 指点</P> SSGET应该是获取选择集的意思 好像没有什么实用价值 <P>本人是做模具行业的 我觉得对我们行业来讲 还是有一定的用处的. 但对于其他行业 我就不知道拉!</P> <P>(defun c:ct1 (/ )<BR> (setvar "cmdecho" 0)<BR> (command "undo" "be")<BR> (prompt "\nSelect two texts:")<BR> (setq el (ssget '((0 . "TEXT"))))<BR> (setq len (sslength el))<BR> (if (> len 2)<BR> (progn (alert "Too Many Texts!") (exit))<BR> )<BR> (setq en1 (entget (ssname el 0)))<BR> (setq en2 (entget (ssname el 1)))<BR> (setq p1 (assoc 1 en1)) ;文字内容<BR> (setq q1 (assoc 1 en2))<BR> (setq p2 (cons 1 (cdr q1)))<BR> (setq q2 (cons 1 (cdr p1)))<BR> (setq p3 (subst p2 p1 en1))<BR> (entmod p3)<BR> (setq q3 (subst q2 q1 en2))<BR> (entmod q3)<BR> (command "undo" "e")<BR> (setvar "cmdecho" 1)<BR> (princ)<BR>)</P>
<P>这是偶写的第一个程序。还好当时有高人指点了一下,才完成的。</P> 楼主辛苦了!这个LSP对于机械或模具行业还是有一点帮助的,谢谢分享!
页:
[1]
2