1) 铰链点
2) 宽度-开口的另一侧
3) 将取决于是否需要翻转,如果是,请单击门扇的末端以翻转翻转,或者如果单击第三个点是正确的,请单击铰链点上的后退,门将不会翻转。
它从一个宏开始工作,你可以将它放在工具面板、菜单或riibbon上,并反复运行,直到你点击escape。我住在世界的公制一边,所以如果你使用那些有趣的测量方法,它将需要适应。无论如何,请看一看包含起始块和要练习的7面墙的附图,该块有一个对齐参数,因此当您拾取第一个点(铰链)时,您接近拾取点的墙的一侧将确定门放置在墙的哪一侧,这就是您获得练习墙的原因。
这是放置门的宏。
*^C^C^C._insert;Door;end;\;;;_scale;last;;$M=$(getvar,lastpoint);reference;1000;\explode;last;_mirror;last;;$(index,0,$(getvar,lastpoint)),$(index,1,$(getvar,lastpoint));\y;
门图纸 这里有一个尝试,直到更好的事情出现。不是优雅,不是错误陷阱,但似乎正如你所说的那样。
(defun c:door (/ len ln1 pt1 pt2 pt3 pt4 pt5)
(setq pt1 (getpoint "\nSelect Hinge Point: ")
pt2 (getpoint "\nSelect Jam Point: ")
len (distance pt1 pt2)
pt4 (polar pt1 (+ (angle pt1 pt2) (/ pi 2)) len)
pt5 (polar pt1 (- (angle pt1 pt2) (/ pi 2)) len)
)
(command "._LINE" pt4 pt5 "")
(setq ln1 (entlast))
(setq pt3 (getpoint "\nPick End Of Line On Swing Side: "))
(if
(equal pt3 pt4 0.000001)
(command "._ARC" pt2 "_C" pt1 pt3)
(command "._ARC" pt3 "_C" pt1 pt2)
)
(command "._PLINE" pt1 pt3 "")
(entdel ln1)
(princ)
)
我很好奇为什么它不能是一个街区? 这是从一些现有例程中拼凑而成的:
[列表]
[*]防火商业门框
[*]2“门板
[*]最小4“壁厚
[/列表]
虽然不好看,但很多都是在20世纪90年代写的
(defun c:door2d (/ h f hf dd d s o w ll bn hp i a)
(initget 1 "Right Left")
(setq h (getkword "\nDoor Hinging - Right/Left: "))
(initget 6)
(setq f (getdist "\nOverall Frame Width <40>: "))
(or f (setq f 40))
(setq hf (* f 0.5))
(setq dd (- f 4))
(initget 6)
(setq d (getdist (strcat "\nDoor Panel Width <" (rtos dd 2 2) ">: ")))
(or d (setq d dd))
(setq s (* (- f d) 0.5))
(while (or (not o)
(> o (* pi (/ 170.01 180))
(< o (/ pi 6))))
(initget 5)
(setq o (getangle "\nOpen Angle Min 30 Max 170 <90>: "))
(or o (setq o (* pi 0.5))))
(while (or (not w)
(< w 4))
(initget 6)
(setq w (getdist "\nWall Thickness - Min 4 <6>: "))
(or w (setq w 6)))
(defun makel (p1 p2)
(entmake (list (cons 0 "LINE")
(cons 8 "2D-DOOR")
(cons 6 "BYLAYER")
(cons 39 0)
(cons 62 256)
(cons 10 p1)
(cons 11 p2))))
(setq ll (list
(list (list (- hf) 0 0)
(list (- hf) 0.5 0))
(list (list (+ hf) 0 0)
(list (+ hf) 0.5 0))
(list (list (+ (- hf) 0) 0.5 0)
(list (+ (- hf) s) 0.5 0))
(list (list (- (+ hf) 0) 0.5 0)
(list (- (+ hf) s) 0.5 0))
(list (list (+ (- hf) s)0.5 0)
(list (+ (- hf) s) -1.5 0))
(list (list (- (+ hf) s)0.5 0)
(list (- (+ hf) s) -1.5 0))
(list (list (+ (- hf) s 0.0) -1.5 0)
(list (+ (- hf) s 0.5) -1.5 0))
(list (list (- (+ hf) s 0.0) -1.5 0)
(list (- (+ hf) s 0.5) -1.5 0))
(list (list (+ (- hf) s 0.5) -1.5 0)
(list (+ (- hf) s 0.5) (+ (- w) 1.5) 0))
(list (list (- (+ hf) s 0.5) -1.5 0)
(list (- (+ hf) s 0.5) (+ (- w) 1.5) 0))
(list (list (+ (- hf) s 0.0) (- (- w) 0.5) 0)
(list (+ (- hf) s 0.0) (+ (- w) 1.5) 0))
(list (list (- (+ hf) s 0.0) (- (- w) 0.5) 0)
(list (- (+ hf) s 0.0) (+ (- w) 1.5) 0))
(list (list (+ (- hf) s 0.5) (+ (- w) 1.5) 0)
(list (+ (- hf) s 0.0) (+ (- w) 1.5) 0))
(list (list (- (+ hf) s 0.5) (+ (- w) 1.5) 0)
(list (- (+ hf) s 0.0) (+ (- w) 1.5) 0))
(list (list (- hf) (- w) 0)
(list (- hf) (- (- w) 0.5) 0))
(list (list (+ hf) (- w) 0)
(list (+ hf) (- (- w) 0.5) 0))
(list (list (+ (- hf) 0) (- (- w) 0.5) 0)
(list (+ (- hf) s) (- (- w) 0.5) 0))
(list (list (- (+ hf) 0) (- (- w) 0.5) 0)
(list (- (+ hf) s) (- (- w) 0.5) 0))
))
(entmake (list (cons 0 "BLOCK")(cons 2 "*U")(cons 70 1)(list 10 0 0 0)))
(and (= h "Right")
(setq hp (list (+ (- hf) s) 0.5 0))
(entmake (list (cons 0 "LINE")
(cons 8 "2D-DOOR")
(cons 10 hp)
(cons 11 (polar hp o d))))
(entmake (list (cons 0 "ARC")
(cons 8 "2D-DOOR")
(cons 10 hp)
(cons 40 d)
(cons 50 0)
(cons 51 o))))
(and (= h "Left")
(setq hp (list (- (+ hf) s) 0.5 0))
(entmake (list (cons 0 "LINE")
(cons 8 "2D-DOOR")
(cons 10 hp)
(cons 11 (polar hp (- pi o) d))))
(entmake (list (cons 0 "ARC")
(cons 8 "2D-DOOR")
(cons 10 hp)
(cons 40 d)
(cons 50 (- pi o))
(cons 51 pi))))
(foreach l ll
(makel (car l) (cadr l)))
(setq bn (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))))
(initget 1)
(setq i (getpoint "\nINSERT Point: "))
(initget 1)
(setq a (getangle i "\nINSERT Angle: "))
(entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 i)(cons 50 a)))
(prin1))
-大卫 我很确定,根据OP,只需要绘制两个对象。1) 表示门的单线和2)表示门摆动的90度弧。其他任何事情都是多余的。
把门框线取出来很容易。我们只能拭目以待。 我原以为这很容易,但在用entmake创建一个圆弧时遇到了麻烦,让它转270度,而不是一半时间转90度。我知道它为什么这样做,但似乎无法回避。希望有人能从我停下来的地方补上
(defun c:door ()
(initget 1)
(setq pt1 (getpoint "\nInsertion Point: ")
pt2 (getpoint "\nDoor Width: ")
an1 (getangle pt1 "\nSwing Direction: ")
an2 (angle pt1 pt2)
dis (distance pt1 pt2)
pt3 (polar pt1 an1 dis))
;(cond ((<= an2 (- an1 pi))
; (setq temp (list an1 an2)
; an1 (cadr temp)
; an2 (car temp))
; )
;)
(command "line" pt1 pt3 "")
(entmake (list (cons 0 "ARC")
(cons 10 pt1)
(cons 40 dis)
(cons 50 an2)
(cons 51 an1)))
(princ))
我觉得这太令人印象深刻了! 我喜欢门框大卫,这是下一件事要做的“Cadarc”它就像你的程序开始生活在1990年代
I like the door jambs David, it was the next thing to do to "Cadarc" its like your program started life 1990's
页:
1
[2]