- (defun c:tt ()
- (if (and
- (setq p1 (getpoint "\n指定等腰三角形底边起点"))
- (setq p2 (getpoint p1"\n指定等腰三角形底边终点"))
- (progn
- (vl-cmdf "LINE" p1 p2 "")
- (setq ent (entlast))
- t
- )
- (setq midpoint (list (/ (+ (car p1) (car p2)) 2)
- (/ (+ (cadr p1) (cadr p2)) 2)
- )
- )
- (setq p3 (getpoint midpoint"\n指定顶点方向"))
- )
- (progn
- (entdel ent)
- (setq p4 (polar p3 (+ (angle p1 p2) (* pi 0.5)) 100))
- (setq p5 (inters p1 p2 p3 p4 nil))
- (setq p6 (polar midpoint (angle p5 p3) (distance p3 p5)))
- (setvar "OSMODE" 0)
- (command "pline" p1 p2 p6 "c")
- (princ "\n等腰三角形已绘制。\n")
- )
- )
- (princ)
- )
|