jfxia 发表于 2011-6-2 12:40
xyp1964 版主可有源码分享?? - ;; 半径直径标注
- (defun c:test988 ()
- (CMDLA0)
- (xyp-MkLaCo "TEST" 3)
- (setq ss (ssget '((0 . "circle,arc")))
- i -1
- )
- (xyp-Group0)
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq p0 (xyp-get-dxf 10 s1)
- r (xyp-get-dxf 40 s1)
- )
- (if (= (xyp-get-dxf 0 s1) "ARC")
- (progn
- (setq l1 (xyp-get-CurveLength s1)
- l2 (* pi 2 r)
- s2 (xyp-Dim-Rad s1 (xyp-get-CurveMidPoint s1))
- tx (strcat "M" (rtos (xyp-get-dxf 42 s2) 2 0))
- )
- (if (>= l1 (* l2 0.75))
- (xyp-SubUpd s2 1 tx)
- )
- )
- (progn
- (xyp-Dim-Dia s1)
- (xyp-rotate (entlast) p0 -45)
- )
- )
- )
- (xyp-Group1)
- (CMDLA1)
- )
|