- (defun c:lsp_05()
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "\n起点: "))
- (command "pline" pt1)
- (setq pt2 (getpoint pt1 "\n第2点: "))
- (command pt2)
- (setq pt3 (getpoint pt2 "\n第3点: "))
- (command pt3)
- (setq pt4 (getpoint pt3 "\n第4点: "))
- (command pt4)
- (setq pt5 (getpoint pt4 "\n第5点: "))
- (command pt5 "c")
- (setq dist1-2 (distance pt1 pt2))
- (setq dist2-3 (distance pt2 pt3))
- (setq dist3-4 (distance pt3 pt4))
- (setq dist4-5 (distance pt4 pt5))
- (setq dist5-1 (distance pt5 pt1))
- (setq cc '())
- (setq cc (cons (list dist1-2 pt1 pt2) cc))
- (setq cc (cons (list dist2-3 pt2 pt3) cc))
- (setq cc (cons (list dist3-4 pt3 pt4) cc))
- (setq cc (cons (list dist4-5 pt4 pt5) cc))
- (setq cc (cons (list dist5-1 pt5 pt1) cc))
- (setq max_dd (max dist1-2 dist2-3 dist3-4 dist4-5 dist5-1))
- (setq min_dd (min dist1-2 dist2-3 dist3-4 dist4-5 dist5-1))
- (setq max_pt (assoc max_dd cc))
- (setq max_pt1 (cadr max_pt))
- (setq max_pt2 (caddr max_pt))
- (setq max_ptm (polar max_pt1 (angle max_pt1 max_pt2) (/ max_dd 2)))
- (setq min_pt (assoc min_dd cc))
- (setq min_pt1 (cadr min_pt))
- (setq min_pt2 (caddr min_pt))
- (command "arc" max_pt1 "e" max_ptm "a" 180)
- (command "arc" max_ptm "e" max_pt2 "a" 180)
- (command "arc" min_pt1 "e" min_pt2 "a" 180)
- (prin1)
- )
命令: lsp_05
起点:
第2点:
第3点:
第4点:
第5点:
半径必须非零。
; 错误: 函数被取消
*无效*
以上是在直线为146的情况下显示出来的,我用CAD画的感觉直线不短呀,怎么就画不出来呢?
该贴已经同步到 chenlight的微博 |