本帖最后由 xyp1964 于 2012-4-17 12:44 编辑
- ;; 尺寸位置调整之伪源码
- (defun c:tt (/ i ss s1 p14 p10 la pt)
- (CMDLA0)
- (setq i -1)
- (princ "\n选择标注实体: ")
- (if (setq ss (ssget '((0 . "DIMENSION") (8 . "DIM,TK")))) ;图层DIM和TK可根据需要调整
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq p14 (xyp-get-dxf 14 s1)
- p10 (xyp-get-dxf 10 s1)
- la (xyp-get-dxf 8 s1)
- pt (cond ((= la "DIM") (polar p14 (angle p14 p10) 1600)) ;外侧总尺寸
- ((= la "TK") (polar p14 (angle p14 p10) 800)) ;内侧分尺寸
- )
- )
- (xyp-SubUpd s1 10 pt)
- )
- )
- (CMDLA1)
- )
|