alevans Posted October 7, 2018 Posted October 7, 2018 Hi everyone, I'm looking to close off a door in auto cad. Basically I want to extend a line between the center of an arc and its start point. Basically though, I am trying to loop through a drawing and do this for all doors (there are many!). I've attached a picture, where the door is in purple, and the part I am trying to extend is blue. It would be even better if I could get the wall (in red), to do this extension. Note: The arc and connecting purple line are not one solid poly line but separate entities (however they are on the same layer), and the wall (in red) is a separate layer. Thanks, A Quote
marko_ribar Posted October 7, 2018 Posted October 7, 2018 If I were you, I would already drawn that line manually - I mean - how did you draw door specification - you certainly haven't used automatic insertions between wall openings... Even if you had door block - but you stated that it's line and arc, you probably had to manually position them in correct orientation according to wall... So my suggestion - you don't have millions of doors to process, just draw that line and at the end freeze layer of doors... 1 Quote
alevans Posted October 7, 2018 Author Posted October 7, 2018 (edited) Hi Marko, thanks for the reply. I actually have not designed these drawings, and am not an architect or civil engineer. I am fairly new to autocad and autolisp (basic working proficiency), and am tasked with automating certain things. The idea behind these lines is the eventual creation of a boundary. I have managed to simplify my floor plan down to a before and after, with the differences highlighted. The reason I cannot manually draw these lines is that I do not know how many of these dwg files will eventually need to be processed, so am looking for a general solution. Right now I have 3 layers of broken walls and am trying to connect them via 90 degree angles. A picture would probably better illustrate this. This is what I am looking to accomplish. [EDIT: Please don't worry about the text, I have deleted that. Also the yellowed circle object is not a big problem either] Thanks, A Edited October 7, 2018 by alevans Forgot to include some specifications, sorry Quote
BIGAL Posted October 8, 2018 Posted October 8, 2018 Agree with Marko If I draw a door I draw all of it including the door frame but I have a lisp to do it, it asks the relevant questions how far from edge size of door left right in/out and all done. It copyrighted. 1 Quote
ronjonp Posted October 8, 2018 Posted October 8, 2018 (edited) If your doors are blocks just add that linework to the block definition on a different layer. Never mind just read your post more closely. Edited October 8, 2018 by ronjonp 1 Quote
BIGAL Posted October 9, 2018 Posted October 9, 2018 Serach for door lisp I am sure there are some free ones out there, mine takes into account intelligence about the wall its inserting into. 1 Quote
ronjonp Posted October 9, 2018 Posted October 9, 2018 You could use a dynamic block with a mask, then you don't need to break the walls. 1 Quote
alevans Posted October 11, 2018 Author Posted October 11, 2018 Thanks everyone, I will try to implement these solutions. A Quote
ronjonp Posted October 11, 2018 Posted October 11, 2018 (edited) Post a sample of your drawing, if you need code to cleanup these existing plans I have an idea. Edited October 11, 2018 by ronjonp 1 Quote
ronjonp Posted October 12, 2018 Posted October 12, 2018 (edited) On 10/11/2018 at 6:34 PM, alevans said: Hey ron(or jon?), here's the sample. Cheers man, Thanks. A Sample.dwg Give this a try for closing the doors that consist of a line and an arc on layer "A_DOOR_FULL" .. looking at that drawing I'd recommend some consistency first (defun c:foo (/ _get b c d s) ;; RJP » 2018-10-12 ;; Closes doors on a common layer that consist of an arc and a line (defun _get (e) (list (vlax-curve-getstartpoint e) (vlax-curve-getendpoint e))) (cond ;; Layer filter below '(8 . "A_DOOR_FULL")' ((setq s (ssget "_x" '((0 . "line,arc") (8 . "A_DOOR_FULL")))) (foreach a (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (if (= "LINE" (cdr (assoc 0 (entget a)))) (setq b (cons (_get a) b)) (setq c (cons (_get a) c)) ) ) (foreach p b (cond ((setq d (vl-some '(lambda (x) (if (or (equal (setq e (car p)) (car x) 1e-8) (equal (setq e (car p)) (cadr x) 1e-8) (equal (setq e (cadr p)) (car x) 1e-8) (equal (setq e (cadr p)) (cadr x) 1e-8) ) x ) ) c ) ) (setq d (vl-remove-if '(lambda (x) (equal e x 1e-8)) (append d p))) (entmakex (list '(0 . "LINE") (cons 10 (car d)) (cons 11 (cadr d)) '(8 . "DoorClosed"))) ) ) ) ) ) (princ) ) Edited October 15, 2018 by ronjonp 1 Quote
alevans Posted October 13, 2018 Author Posted October 13, 2018 (edited) Ronjon, you're a genius! Thank you so much man. It works for the yellow checked doors, but not the other ones (hinged?). I tried to switch this line (0 . "line,arc") (8 . "A_DOOR_FULL") to ( 0 . "polyline, arc") to see if it would select the other ones, but no luck. Exploding all of the poly-lines gets something close, and we end up with the other picture. I have spent some time trying to disassemble your code to modify it slightly, but was unsuccessful. I tried to delete inner line of door, merge layers, fiddle with the code variables, but no luck. I really appreciate the help everyone, my head is spinning. I'll pay it forward. EDIT: For certain drawings this is perfectly ok. Once again, thanks everyone A Edited October 13, 2018 by alevans Forgot to add something Quote
ronjonp Posted October 15, 2018 Posted October 15, 2018 On 10/13/2018 at 5:53 PM, alevans said: Ronjon, you're a genius! Thank you so much man. It works for the yellow checked doors, but not the other ones (hinged?). I tried to switch this line (0 . "line,arc") (8 . "A_DOOR_FULL") to ( 0 . "polyline, arc") to see if it would select the other ones, but no luck. Exploding all of the poly-lines gets something close, and we end up with the other picture. I have spent some time trying to disassemble your code to modify it slightly, but was unsuccessful. I tried to delete inner line of door, merge layers, fiddle with the code variables, but no luck. I really appreciate the help everyone, my head is spinning. I'll pay it forward. EDIT: For certain drawings this is perfectly ok. Once again, thanks everyone A Glad to help out . Your other doors get a bit more complicated to check. That's why I suggested some consistency ... dynamic blocks are perfect for this application. 1 Quote
BIGAL Posted October 16, 2018 Posted October 16, 2018 Whilst ronjonp has provide a real good answer I would still look at ignoring what you have and start from scratch and make some draw door routines there are not that many combos, 2 line walls or 4 lines wall etc and the door its self has only 4 combinations left-right, in-out. You start by picking say near an end of a line, nominate offset from say corner then width of door and other wall side then break and draw door. 1 Quote
alevans Posted October 18, 2018 Author Posted October 18, 2018 Sorry guys, not around everyday. Just wanted to say thanks again everyone, and to everyone else looking for similar solutions, it will work as illustrated above. A 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.