Close off doors and form a boundary

Close off doors and form a boundary

Anonymous
Not applicable
1,074 Views
4 Replies
Message 1 of 5

Close off doors and form a boundary

Anonymous
Not applicable

Hi everyone,

 

I'm trying to come up with a way to delete door arcs, extend across them, and form a boundary where I can measure the area. If the boundary is under a certain square footage then I want to delete it.

 

Any help is appreciated,

 

Thanks!

 

 

0 Likes
1,075 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... 

I'm trying to come up with a way to delete door arcs, extend across them, and form a boundary where I can measure the area. …. 


 

Really delete them?  Or just work around them?  What are they?  Arc entities?  Parts of Blocks?  Something else [I dunno -- Polylines maybe...]?  What about the door itself, apart from the swing arc?  Are the arcs on a different Layer than the door-itself elements, and/or the [presumably] wall elements?  What are the door-itself and wall elements drawn with?

 

Best idea I can think of:  have the doors [including their swing arcs] as Blocks, and include in the Block definition a door-head Line, on a different Layer.  Turn off  the door-&-arc Layer, and turn on the door-head Layer, and BOUNDARY or BPOLY should work quite cleanly.  Reverse that Layer on/off condition to restore to the ordinarily-visible plan elements.  [I find that kind of approach beneficial for other reasons, such as Reflected Ceiling Plans, which will use that door-head Line.]

Kent Cooper, AIA
Message 3 of 5

hak_vz
Advisor
Advisor

@Anonymous wrote:

I'm trying to come up with a way to delete door arcs, extend across them, and form a boundary where I can measure the area. If the boundary is under a certain square footage then I want to delete it.


I hope this will work for you! Use command BON to create boundary and to find its enclosed area. I have  tested it and it works ok for all cases , but in some circumstances it may fail. You may use command DLAST to delete last created object, modify my code for direct boundary erasure, or use what ever you fancy.

 

(defun c:dlast() (entdel(entlast)) (redraw))
(defun c:bon ( / pt allsegs test pts) (setvar "cmdecho" 0) (defun getPolySegs ( ent / entl p1 pt bulge seg ptlst) (setq entl (entget ent)) (cond (ent (if (= (logand (cdr (assoc 70 entl)) 1) 1) (setq p1 (cdr (assoc 10 entl))) ) (while (setq entl (member (assoc 10 entl) entl)) (if (and pt bulge) (setq seg (list pt bulge)) ) (setq pt (cdr (assoc 10 entl)) bulge (cdr (assoc 42 entl)) ) (if seg (setq seg (append seg (list pt)) ptlst (cons seg ptlst)) ) (setq entl (cdr entl) seg nil ) ) ) ) (if p1 (setq ptlst (cons (list pt bulge p1) ptlst))) (reverse ptlst) ) (setq pt (getpoint "\nSelect internal point > ")) (command "-boundary" pt "") (setq allsegs (getPolySegs (entlast))) (while (and allsegs) (setq test (car allsegs) allsegs (cdr allsegs)) (if (not(eq (cadr test) 0)) (setq allsegs (cdr allsegs)) (setq pts (append pts (list(car test)))) ) ) (entdel (entlast)) (command "pline" pts "c" "") (setvar "cmdecho" 1) (command "_.area" "e" (entlast) "") (setq _area (getvar "area")) (redraw) (princ (\n "Area is > " _area)) )

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 4 of 5

Anonymous
Not applicable

Thank you hak and Kent! I really appreciate the help. I am quite new to both Autocad and Autolisp, and have been banging my head trying not only to understand it but to implement solutions.

 

The bon function is very close to what I am looking for. The layer colour is green for simplicity for the desired output and I have also made it green for the current output.

 

All of the windows, walls, and so on are all on different layers and don't appear to be poly-lines, but individual entities. I am not sure if this is clear enough? I should clarify that I am receiving these files, and am not the architect of them.

 

In addition to this; I am looking to implement the following:

 

a) Delete all door arcs and replace them with lines from centre to end point.
b) Delete all windows and replace with a line segment in the long direction.
c) Copy all wall elements onto a new layer called "Boundary", along with the arc centre-end lines (one per arc) that join across gaps in these lines, and line segments replacing the window elements.
 
Maybe the pictures will better showcase what I am trying to accomplish here

 

 

 

0 Likes
Message 5 of 5

hak_vz
Advisor
Advisor

Can you provide original dwg for easier work?

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.