Jump to content

Flipping (not rotating) door blocks


Hsanon

Recommended Posts

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

Link to comment
Share on other sites

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)
)

 

  • Like 2
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

 

 

 

 

 

 

3dhouse-render.png

Link to comment
Share on other sites

Thanks Emmanuel,

It works mostly...... whats left over is just a simple grip-pull away..... 

Thank you so much !!!!

regards

 

 

Link to comment
Share on other sites

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.

 

image.png.4715fa756949fb6fdfdd2136eea2146f.png

Edited by BIGAL
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...