- (defun c:yfl1(/ d1 d2 d3 d4 d5 d6 d7 d8 e1 e2 e3 e4 pt0 pt1 pt2 pt3 p1 );圆法兰
- (command "._undo" "_begin")
- (setvar "cmdecho" 0) ;关闭普通命令提示信息
- (setvar "osmode" 0) ;关闭对象捕捉状态
-
- (setq d1(getreal "\n 法兰内径<151>:"));风管外径和法兰内径
- (if (not d1) (setq d1 151))
- (setq d2(getreal "\n 中心距<191>:"))
- (if (not d2) (setq d2 191))
- (setq d6(getreal "\n 法兰宽度<40>:"))
- (if (not d6) (setq d6 40))
- (setq d3 (+ d1 (* 2 d6)))
- (setq d4(getreal "\n 开孔直径<10>:"))
- (if (not d4) (setq d4 10))
- (setq d5(getint "\n 开孔数量<8>:"))
- (if (not d5) (setq d5 8))
- (SETQ D8(/ (/ 360 D5) 2));分线角度
- (setq d7(/ d3 2))
- (SETQ pt0(getpoint "\n 插入点:"))
- ;上面为所需变量
- (command "circle" pt0 "d" d1)
- (setq e4(entlast))
- (command "circle" pt0 "d" d2)
- (setq e1(entlast))
- (command "circle" pt0 "d" d3);绘制三个圆
- (setq p1(list (car pt0) (+ (cadr pt0) d7)))
- (setq pt1(list (car pt0) (+ (cadr pt0) (/ d2 2))))
- (command "circle" pt1 "d" d4)
- (setq e2(entlast))
- (command "_.ARRAY" e2 "" "P" pt0 d5 "" "")
- (command "erase" e1 "")
- (command "line" pt0 p1 "")
- (setq e3(entlast))
- (command "rotate" e3 "" pt0 d8)
- (setq pt2(list (+ (car pt0) 10) (+ (cadr pt0) 10)));TR点1
- (setq pt3(list (- (car pt0) 10) (- (cadr pt0) 10)));TR点2
- (if
- (> d1 251)
- (progn
- (if
- (<= d1 501)
- (progn
- (command "rotate" e3 "" pt0 "c" 120)
- (command "rotate" e3 "" pt0 "c" 240)
- )
- (progn
- (command "rotate" e3 "" pt0 "c" 90)
- (command "rotate" e3 "" pt0 "c" 180)
- (command "rotate" e3 "" pt0 "c" 270)
- (command "rotate" e3 "" pt0 "c" 360)))
- (command "trim" e4 "" "c" pt2 pt3 "")
- )
- (command "erase" e3 "" ))
-
-
-
- (setvar "osmode" 16383) ;打开对象捕捉状态
- (princ) ;静默退出
- (command "._undo" "_end")
- )
大家帮我看看,使用修剪命令不能完全删除框选范围内的点,是咋回事呢
|