adc 发表于 2015-8-13 19:29
请问院长能不能给看看尺寸平移的代码?自己弄了很久都没搞成,谢啦 - ;; ccpy(尺寸平移)
- (defun c:ccpy (/ ss s1 p1 i pt p14 p13 rad pt1)
- (xyp-Start)
- (princ "\n选择标注尺寸: ")
- (while (setq ss (ssget '((0 . "DIMENSION"))))
- (setq p1 (xyp-dxf 11 (ssname ss 0))
- i -1
- )
- (if (setq pt (getpoint p1 "\n移动位置<退出>: "))
- (progn
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq p14 (xyp-dxf 14 s1)
- p13 (xyp-dxf 13 s1)
- rad (xyp-dxf 50 s1)
- pt1 (polar pt (+ rad (* pi 0.5)) 100)
- pt (inters p14 (polar p14 rad 100) pt pt1 nil)
- )
- (if (< (distance p13 pt) (distance p14 pt))
- (xyp-SUBUPD s1 13 pt)
- (xyp-SUBUPD s1 14 pt)
- )
- )
- )
- )
- )
- (xyp-End)
- )
|