本帖最后由 xyp1964 于 2022-5-17 20:58 编辑
- (defun c:tt ()
- "批量将圆弧的半径调整为10的整数倍,弧长保持不变"
- (setq i -1)
- (if (setq ss (ssget '((0 . "arc"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq ob (vlax-ename->vla-object s1)
- l1 (vla-get-ArcLength ob)
- rr (vla-get-radius ob)
- rr (* (fix (/ rr 10)) 10)
- rr (if (= rr 0)10 rr)
- )
- (vla-put-radius ob rr)
- (setq l2 (vla-get-ArcLength ob)
- dl (* (- l1 l2) 0.5)
- )
- (command "LENGTHEN" "de"dl(list s1 (vlax-curve-getStartPoint s1))(list s1 (vlax-curve-getendPoint s1)) "")
- ;(setq l2 (vla-get-ArcLength ob))(princ l1)(princ " ")(princ l2)
- )
- )
- (princ)
- )
|