本帖最后由 xyp1964 于 2024-9-18 08:01 编辑
 - (defun c:tt ()
- "直线n等分"
- (defun dxf (code e) (cdr (assoc code (entget e))))
- (setq nn (getint "\n等分数量(10): "))
- (or nn (setq nn 10))
- (while (and (setq s1 (car (entsel "\n选择直线<退出>: ")))
- (= (DXF 0 s1) "LINE")
- )
- (setq p1 (DXF 10 s1)
- p2 (DXF 11 s1)
- r (angle p1 p2)
- dd (/ (distance p1 p2) nn 1.)
- )
- (entdel s1)
- (repeat nn
- (entmakex (list '(0 . "line")
- (cons 10 p1)
- (cons 11 (setq p1 (polar p1 r dd)))
- )
- )
- )
- )
- (princ)
- )
|