xuhnsz188 发表于 2006-8-27 22:05:00

本人的第一个实用性的LISP程序

<P></P>
<P>本人写的把所有虚线转换成黄色的虚线(但对与随层的虚线无用)</P>
<P>希望大家以后能多多指点!谢谢</P>

dx163805 发表于 2006-8-28 08:59:00

顶一个

<P>谢谢,自己的辛苦大家来享用,楼主,高,谢谢</P>

ZZXXQQ 发表于 2006-8-28 12:13:00

<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>&nbsp; <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>&nbsp; <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>&nbsp; <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>&nbsp; <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>&nbsp; <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>

ntwzym 发表于 2006-8-28 13:52:00

高,谢谢

xuhnsz188 发表于 2006-9-8 21:55:00

<P>谢谢 指点</P>

liexol 发表于 2006-9-24 20:30:00

SSGET应该是获取选择集的意思

ntwzym 发表于 2006-9-26 15:21:00

好像没有什么实用价值

xuhnsz188 发表于 2006-9-26 20:57:00

<P>本人是做模具行业的 我觉得对我们行业来讲 还是有一定的用处的. 但对于其他行业 我就不知道拉!</P>

pleasehelp 发表于 2006-9-26 22:30:00

<P>(defun c:ct1 (/ )<BR>&nbsp; (setvar "cmdecho" 0)<BR>&nbsp; (command "undo" "be")<BR>&nbsp; (prompt "\nSelect two texts:")<BR>&nbsp; (setq el (ssget '((0 . "TEXT"))))<BR>&nbsp; (setq len (sslength el))<BR>&nbsp; (if (&gt; len 2)<BR>&nbsp;&nbsp;&nbsp; (progn (alert "Too Many Texts!") (exit))<BR>&nbsp; )<BR>&nbsp; (setq en1 (entget (ssname el 0)))<BR>&nbsp; (setq en2 (entget (ssname el 1)))<BR>&nbsp; (setq p1 (assoc 1 en1))&nbsp;&nbsp;;文字内容<BR>&nbsp; (setq q1 (assoc 1 en2))<BR>&nbsp; (setq p2 (cons 1 (cdr q1)))<BR>&nbsp; (setq q2 (cons 1 (cdr p1)))<BR>&nbsp; (setq p3 (subst p2 p1 en1))<BR>&nbsp; (entmod p3)<BR>&nbsp; (setq q3 (subst q2 q1 en2))<BR>&nbsp; (entmod q3)<BR>&nbsp; (command "undo" "e")<BR>&nbsp; (setvar "cmdecho" 1)<BR>&nbsp; (princ)<BR>)</P>
<P>这是偶写的第一个程序。还好当时有高人指点了一下,才完成的。</P>

honxj 发表于 2006-11-4 22:06:00

楼主辛苦了!这个LSP对于机械或模具行业还是有一点帮助的,谢谢分享!
页: [1] 2
查看完整版本: 本人的第一个实用性的LISP程序