jweber Posted January 22, 2017 Posted January 22, 2017 I need something that will allow me to choose a door opening, either by line selecting or choosing two points, and then decide the door swing and side of the line. Also, I need the lines to be essentially a quarter circle with a polyline drawn out to the quadrant. Simple single lines is all I need. Per your request- Pick an origin point, door opening width, and then swing angle. Simple lines. Let me know if it works for you. (defun c:door (/ pt1 pt2 an1 ang2 dis pt3 a_object a_length ) (initget 1) (setq pt1 (getpoint "\nInsertion Point: ") pt2 (getpoint "\nDoor Opening Width: ") an1 (getangle pt1 "\nSwing Direction: ") an2 (angle pt1 pt2) dis (distance pt1 pt2) pt3 (polar pt1 an1 dis)) (command "line" pt1 pt3 "") (entmake (list (cons 0 "ARC") (cons 10 pt1) (cons 40 dis) (cons 50 an2) (cons 51 an1))) (setq a_object (vlax-ename->vla-object (entlast))) (setq a_length (vlax-curve-getdistatparam a_object (vlax-curve-getendparam a_object ))) (cond ((>= a_length (* dis pi)) (vla-delete a_object) (entmake (list (cons 0 "ARC") (cons 10 pt1) (cons 40 dis) (cons 50 an1) (cons 51 an2))) )) (princ)) Quote
David Bethel Posted January 22, 2017 Posted January 22, 2017 I like the door jambs David, it was the next thing to do to "Cadarc" its like your program started life 1990's Thanks ! I looked at my current 3D door program for starters. Even as my newest, it was started 2008. Quote
David Bethel Posted January 22, 2017 Posted January 22, 2017 (edited) Not to hijack a thread, but I needed to update my door routine any way 1.2 Added door knobs This is pretty much the format I use for complete routine Maybe it could help. -David DOOR3D.LSP NEWDHAND.DWG NEWDKNOB.DWG NEWDPULL.DWG Edited January 23, 2017 by David Bethel Added a few options Quote
tzframpton Posted January 22, 2017 Posted January 22, 2017 Thanks ! I looked at my current 3D door program for starters. Even as my newest, it was started 2008.This is very Revit-ish. Good door David. -TZ Quote
BIGAL Posted January 23, 2017 Posted January 23, 2017 Nice one David. Its amazing what you can do with 2.5D combined with a bit of full 3D. Quote
David Bethel Posted January 23, 2017 Posted January 23, 2017 Thanks guys ! The Revit-ish probably comes from the fact I used a R13 SHADE and then SAVEIMG. From what I've seen of Revit, the screen can look like this 2.5D LOL. It's kind of amazing the changes in the definition of the term extrusion in CAD has changed over the years -David I updated post #22 with few fixes and options Quote
tzframpton Posted January 23, 2017 Posted January 23, 2017 The Revit-ish probably comes from the fact I used a R13 SHADE and then SAVEIMG. From what I've seen of Revit, the screen can look like thisI was referring to the parametric program as well as the look of the door. -TZ Quote
David Bethel Posted January 23, 2017 Posted January 23, 2017 I was referring to the parametric program as well as the look of the door. -TZ OH I don't think that I have seen a Revit parametric. This could be done in DCL, but what a lot of work ! NOT today, or anytime soon Quote
tzframpton Posted January 23, 2017 Posted January 23, 2017 OH I don't think that I have seen a Revit parametric. Everything in Revit is parametric. All of the examples of your kitchen equipment remind me of Revit. You've been using AutoCAD like Revit for a long time, actually. *EDIT* Sorry to derail. Please continue normal topic. -TZ Quote
Clifford169 Posted March 15, 2017 Author Posted March 15, 2017 Here's one to try until something better comes along. Not elegant, not error trapped, but seems to work as you indicated. (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) ) Really happy with the code provided above - does exactly what I was hoping it would do. Was just hoping that I could tweak it so that it draws into layer 'DOOR' (continuous, colour that is already set-up in our template drawing. I've tried to control it with Lee Mac's layer director, but it doesn't keep the layer once the 'door' command is completed. Thanks! Quote
BKT Posted March 15, 2017 Posted March 15, 2017 Really happy with the code provided above - does exactly what I was hoping it would do. Was just hoping that I could tweak it so that it draws into layer 'DOOR' (continuous, colour that is already set-up in our template drawing. I've tried to control it with Lee Mac's layer director, but it doesn't keep the layer once the 'door' command is completed. Thanks! If you already have the layer created, you could add some code to change the current layer to "door", place the door, then change back to the original layer: (defun c:door (/ len ln1 pt1 pt2 pt3 pt4 pt5) (setvar "CMDECHO" 0) (setq pt1 (getpoint "\nSelect Hinge Point: ") pt2 (getpoint "\nSelect Width 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)) (command "._CHPROP" ln1 "" "C" "Red" "") (setq pt3 (getpoint "\nPick End Of RED LINE On Swing Side: ")) [color=red](setq cly (getvar "CLAYER")) (setvar "CLAYER" "door")[/color] (if (equal pt3 pt4 0.000001) (command "._ARC" pt2 "_C" pt1 pt3) (command "._ARC" pt3 "_C" pt1 pt2) ) (command "._PLINE" pt1 pt3 "") (entdel ln1) [color=red](setvar "CLAYER" cly)[/color] (princ) ) Quote
Clifford169 Posted March 16, 2017 Author Posted March 16, 2017 If you already have the layer created, you could add some code to change the current layer to "door", place the door, then change back to the original layer:... Works like a dream! Thanks for this. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.