选择圆,所选圆在其圆心处画一条直线
<p>求以下功能:选择圆,所选圆在其圆心处画一条直线</p><p> 就是圆到圆边上的半径直线,谢谢</p> 本帖最后由 作者 于 2008-10-6 16:43:31 编辑 <br /><br /> <p>已经解决,.............................</p><p>(DEFUN C:CCH ( / SS OLDL OLDOS N I PC D PT1 PT2 PT3 PT4 A DL NN)<br/>(SETVAR "CMDECHO" 0) <br/>(PRINC "\nSelect Circle(s) :\n说明:请选择要标注的所有圆回车,点选圆便可自动画半径引线前面如不选到的圆则无效")<br/>(setq snp(getvar "osmode"))<br/> (setq obj (ssget '((0 . "CIRCLE"))))<br/> (setvar "osmode" 0)<br/> (setq num 0)<br/> (IF (setq SS (SSGET '((0 . "CIRCLE")))) (PROGN<br/> (SETQ OLDL (GETVAR "CLAYER") OLDOS (GETVAR "OSMODE")<br/> N (SSLENGTH SS) I 0)<br/> (COMMAND "LAYER" "M" "CUT" "")<br/> (SETVAR "OSMODE" 0)<br/> (REPEAT N<br/> (while (< num (sslength obj))<br/> (setq ent(entget(ssname obj num)))<br/> (setq cen(cdr(assoc 10 ent)))<br/> (setq r(cdr(assoc 40 ent)))<br/> (setq right(polar cen 0.0 (* 1.0 r)))<br/> (setq left(polar cen pi (* 0 r)))<br/> (setq top(polar cen (/ pi 2) (* 0 r)))<br/> (setq bottom(polar cen (* pi 0) (* 0 r)))<br/> (command "line" left right ""<br/> "line" top bottom "")<br/> (setq num (+ num 1))<br/> )<br/> (setvar "osmode" snp)<br/>(PRINC)<br/>))<br/>)<br/>)<br/></p> 谢谢分享,学习一下 学习了!
页:
[1]