liu22737 发表于 2005-9-15 20:05:00

源码

本帖最后由 作者 于 2005-9-15 20:44:52 编辑 <br /><br /> <P>&nbsp;回复七楼:</P>
<P>忘记加载我的通用函数;</P>
<P>我又传一个。你再试一下。</P>
<P>不支持中文图层</P>

HuaiYu 发表于 2005-9-15 23:14:00

<P>小兄弟,你用的图层有点象 富金的图层似的</P>

HuaiYu 发表于 2005-9-16 23:09:00

<P>请<A name=56959><FONT color=#000066><B>yedajiang</B></FONT></A>兄指点</P>
<P>(defun c:test (/ lst)<BR>&nbsp; (vl-load-com)<BR>&nbsp; (if (ssget '((0 . "circle")))<BR>&nbsp;&nbsp;&nbsp; (progn<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq *AcadDocument* (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vla-StartUndoMark *AcadDocument*)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (setq lst (GetLst))<BR>&nbsp;(Display lst)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vla-EndUndoMark *AcadDocument*)<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )<BR>)<BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<BR>(defun Display (lst / TextPt i pt Text StrDia Dia)<BR>&nbsp; (while (not (setq TextPt (Getpoint "\nPlease Specify a point : "))))<BR>&nbsp; (setq&nbsp;old_cmdecho (getvar "cmdecho")<BR>&nbsp;old_osmode&nbsp; (getvar "osmode")<BR>&nbsp; )<BR>&nbsp; (setvar "cmdecho" 0)<BR>&nbsp; (setvar "osmode" 0)<BR>&nbsp; (setq i 0)<BR>&nbsp; (foreach en lst<BR>&nbsp;&nbsp;&nbsp; (setq pt&nbsp;&nbsp; (vlax-safearray-&gt;list<BR>&nbsp;&nbsp; (vlax-variant-value (vla-get-center (vlax-ename-&gt;vla-object (handent (cadr en)))))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp; i&nbsp;&nbsp;&nbsp; (1+ i)<BR>&nbsp;&nbsp; Text (strcat "No" (itoa i))<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (command "text" pt 3.5 0 Text)<BR>&nbsp;&nbsp;&nbsp; (setq StrDia "")<BR>&nbsp;&nbsp;&nbsp; (foreach hn&nbsp;(cdr en)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq Dia&nbsp;&nbsp;&nbsp; (vla-Get-Diameter (vlax-ename-&gt;vla-object (handent hn)))<BR>&nbsp;&nbsp;&nbsp;&nbsp; StrDia (strcat strDia " " (rtos Dia 2 2))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (setq StrDia (strcat Text " " (rtos (car pt) 2 2) " " (rtos (cadr pt) 2 2) " " strDia))<BR>&nbsp;&nbsp;&nbsp; (setq TextPt (list (car TextPt) (- (cadr TextPt) 6)))<BR>&nbsp;&nbsp;&nbsp; (command "text" TextPt 3.5 0 StrDia)<BR>&nbsp; )<BR>&nbsp; (setvar "cmdecho" old_cmdecho)<BR>&nbsp; (setvar "osmode" old_osmode)<BR>)<BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<BR>(defun GetLst (/ ss pt hand lst)<BR>&nbsp; (setq ss (vla-Get-ActiveSelectionset *AcadDocument*))<BR>&nbsp; (setq lst '())<BR>&nbsp; (vlax-for en ss<BR>&nbsp;&nbsp;&nbsp; (setq pt&nbsp;&nbsp; (vlax-safearray-&gt;list (vlax-variant-value (vla-get-center en)))<BR>&nbsp;&nbsp; hand (vla-get-handle en)<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (if&nbsp;(assoc pt lst)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq lst (subst (append (assoc pt lst) (list hand)) (assoc pt lst) lst))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq lst (append lst (list (list pt hand))))<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; )<BR>&nbsp; lst<BR>)</P>

yedajiang 发表于 2005-9-17 10:12:00

HuaiYu发表于2005-9-16 23:09:00static/image/common/back.gif
请yedajiang兄指点
(defun c:test (/ lst)(vl-load-com)(if (...

后天就要出差了,可能没有空详细去理解你程序。十月份回来后一定给你提些建议。请你自己也多关注。<BR>

liu22737 发表于 2005-9-24 22:28:00

哪个富金,富士康吗

jbaobao 发表于 2006-2-5 18:56:00

<P>求助,自动画三视图LISP</P>

redboy008 发表于 2007-12-30 19:43:00

<p>谢谢大大,我想学,可不知道怎么开始,唉~!</p>

redboy008 发表于 2007-12-30 20:00:00

<p><strong><font face="Verdana" color="#61b713">个人比较喜欢liu22737大大编写的,其他大大的我用不会啊。</font></strong></p>

linheyuanpcb 发表于 2008-4-26 15:02:00

谢谢,下载用了

董堃 发表于 2008-5-6 07:02:00

<p>谢谢,我喜欢源码来的,能够学习学习吗</p>
页: 1 [2] 3 4
查看完整版本: 带对话框的圆坐标列表程序