图纸错误
为什么我的代码只运行一次,然后使用不同的坐标。有时,它甚至不画任何东西,除了一个小圆圈。如何使中心线成为线型?(我确实使用了带负值的dimcen使其成为“Line”)
本来会贴照片的,但保护措施起了作用。
(DEFUN C:U13_Bukauskas()
(setq p (getpoint "\nIveskite apskritimo centro koordinates: "))
(setq x (getint "\nIveskite apskritimo skersmeni: "))
(command "color" "t" "0,0,0")
(setq p1 (polar p PI (* x 1.5)))
(setq p1 (polar p1 (/ (* 90 PI) 180) (* 0.5 x)))
(setq p2 (polar p1(* 0.5 PI) (* x 1.5)))
(setq p3 (polar p2 (* 0 PI) (* x 2)))
(setq p4 (polar p3 (* 0 PI) x))
(setq p5 (polar p4 (/ (* 270 PI) 180) (* x 2.5)))
(setq p6 (polar p5 (/ (* 270 PI) 180) (* x 1.5)))
(setq p7 (polar p6 PI (* x 2)))
(setq p8 (polar p7 PI x))
(setq p9 (polar p1 (* 0 PI) (* 2 x)))
(setq p10 (polar p5 PI (* x 2)))
(setq p11 (polar p PI (* x 0.6)))
(setq p12 (polar p 0 (* x 0.6)))
(setq p13 (polar p (/ (* 270 PI) 180) (* x 0.6)))
(setq p14 (polar p (/ (* 90 PI) 180) (* x 0.6)))
(command "Line" p1 p2 "")
(setq L (entlast))
(command "Line" p2 p3 p4 p5 p6 p7 p8 p1 "")
(command "color" "white" "-hatch" "p" "s" "s" L p2 p3 p4 p5 p6 p7 p8 p1 "" "")
(command "color" "t" "0,0,0")
(command "circle" p "d" x "")
(setq aps (entlast))
(command "color" "blue")
(command "dimcen" "-2.5" "")
(command "dimcenter" (list (entlast) (polar p 0 x)) "")
(command "color" "t" "0,0,0")
(command "hatch" "s" aps "")
(command "color" "t" "0,0,0")
(command "Line" p9 p1 "")
(setq E1 (entlast))
(command "Line" p9 p3 "")
(setq E2 (entlast))
(command "Line" p10 p5 "")
(setq E3 (entlast))
(command "Line" p10 p7 "")
(setq E4 (entlast))
(command "fillet" "radius" (* 0.5 x))
(command "fillet" "trim" "T" E1 E2)
(command "fillet" "trim" "T" E3 E4)
) 对象捕捉很可能会干扰命令调用。
也许可以考虑使用entmake(x)创建实体:
(defun line ( s e )
(entmakex
(list
(cons 0 "LINE")
(cons 10 s)
(cons 11 e)
)
)
)
(defun circle ( c r )
(entmakex
(list
(cons 0 "CIRCLE")
(cons 10 c)
(cons 40 r)
)
)
)
可以将对象捕捉变量设置为0,然后将其设置回当前值。这只需要对程序进行很少的编辑。
Add(setq oldsnap(getvar“OSMODE”))要保存当前对象捕捉,请添加(setvar“OSMODE”0)以关闭对象捕捉,然后将(setvar“OSMODE”oldsnap)添加到代码末尾以恢复以前的对象捕捉设置。
绘图设计和绘图服务 谢谢你的回答。天哪,我怎么错过了OSNAP功能?感谢您提供OSNAP关闭/打开的代码。现在一切正常。
至于“Line”类型的中心标记,我只需要使用-1而不是-2.5。
页:
[1]