Hsanon Posted July 18, 2022 Posted July 18, 2022 Hi, Do we have any routine which flips (x, y axis) normal blocks (not dynamic blocks) ??? had tried in basic autolisp, but there seem to be too many permutations.... as in the sample attached. Its a simple door block, 1x1, scaled up tot the width of the door opening (750 / 900 / 100/ 1200..... etc) The insert point is in the corner for easy attachment to wall corners. Flipping it (like in sketchup) at a future time is a bit painful, as it has to be mirrored and then brought into place..... flip samples.dwg Quote
Emmanuel Delay Posted July 18, 2022 Posted July 18, 2022 Yes, you modify the x-scale (assoc 41) or y-scale (assoc 42) to -1 (or to -1 times the current factor). The only thing: flipX will flip it based on the insert point. If the insert point were in the middle-left of the door block, then it would stay in place ... (defun flip_ (ent x y / sc) (if x (progn ;; read the current scale, then multiply be x ( = -1) (setq sc (cdr (assoc 41 (entget ent)))) (setq x (* x sc)) (entmod (subst (cons 41 x) ;; 256 sets the color to ByLayer (assoc 41 (entget ent)) ;; the current color (entget ent) )) ) ) (if y (progn ;; read the current scale, then multiply be y ( = -1) (setq sc (cdr (assoc 42 (entget ent)))) (setq y (* y sc)) (entmod (subst (cons 42 y) ;; 256 sets the color to ByLayer (assoc 42 (entget ent)) ;; the current color (entget ent) )) ) ) ) (defun c:flipx ( / ent) (setq ent (car (entsel "\nSelect door: "))) (flip_ ent -1 nil) ) (defun c:flipy ( / ent) (setq ent (car (entsel "\nSelect door: "))) (flip_ ent nil -1) ) 2 Quote
Steven P Posted July 18, 2022 Posted July 18, 2022 that should work. Might be just as easy in the properties box to multiply the relevant axis by -1 (add a '-' or take it away). If I was doing a lot of drawings with doors I would look at it slightly differently, looking at entmake you can list all the objects that make up a door and create these as a block (minimum 2 lines and an arc, sometimes I also see the frame details too). Make a LIPS say "NewDoor", 3 clicks - hinge, other end of opening and direction to create a door block (if it doesn;t exist), scale and flip all in one go. can find out an example later maybe 1 Quote
BIGAL Posted July 20, 2022 Posted July 20, 2022 Google dynamic door blocks Autocad, it exists it has 4 visibilty modes for L & R In & out a much easier way to go. Like Steven P this is a package and has much more than just doors, walls, roofs, windows and so on. It works on direction and In out. Quote
Hsanon Posted July 20, 2022 Author Posted July 20, 2022 Thanks Emmanuel, It works mostly...... whats left over is just a simple grip-pull away..... Thank you so much !!!! regards Quote
BIGAL Posted July 21, 2022 Posted July 21, 2022 (edited) The method in package is pick near left corner, enter door offset, door width, IN or OUT, Right or Left, It then cuts out the wall, trims above door yes its sort of full 3d its not solids. Edited July 21, 2022 by BIGAL 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.