- (defun c:y57 ()
- (setq OLDOSM (getvar "osmode"))
- (setvar "osmode" 0)
- (setq ent (car (entsel "\n请选取直线:")));_ent 为实体名
- (if ent
- (progn
- (setq el (entget ent))
- (if (equal (cdr (assoc 0 el)) "LINE")
- (progn
- (setq p1 (cdr (assoc 10 el)))
- ;;p1,p2分别为直线的起、终点
- (setq p2 (cdr (assoc 11 el)))
- (setq dist1 (distance p1 p2)) ;读取p1 p2间距
- (setq ang1 (angle p1 p2)) ;读取直线的角度间距
- )
- )
- )
- )
- ;(setq p1 (polar p1 ang1 100));定义钢筋起点
- ;(setq p2 (polar p2 (+ (* 1.0 pi) ang1) 100));定义钢筋终点
- (setq p3 (polar p1 (+ (* 0.25 pi) ang1) 200)) ;定义钢筋起点
- (setq p4 (polar p2 (+ (* 0.75 pi) ang1) 200)) ;定义钢筋起点
- (command "pline" p3 p1 p2 p4 "")
- (entdel ent)
- (setvar "osmode" OLDOSM)
- (princ)
- )
不知道你要什么效果但想画好的话
头
(setq OLDOSM (getvar "osmode"))
(setvar "osmode" 0)
和尾
(setvar "osmode" OLDOSM)
这几段必须加
|