Jump to content

Send all to elevation zero


tazzzz

Recommended Posts

Hello all,

I got a couple of drawings that look fine when I am in top view, but if I change to front or any other view there are lines, and text and dimensions placed at different elevations.

Could you please help me with a lisp that will let me select and send all to elevation zero and to keep the layer properties for each element in the drawing?

Thank you

Link to comment
Share on other sites

Have you tried the Express Tools FLATTEN command?

 

This macro has been known to work too.

 

C^C_move;_all;;0,0,0;0,0,1e99;_move;_p;;0,0,0;0,0,-1e99

 

Another option would be the old CHANGE command and its ELEVATION option.

Link to comment
Share on other sites

ReMark,

The macro gives unpredicted results, Flatten is working only in top view, and Change is not working at all.

Perhaps a different approach will solve the problem.

Thanks for your suggestions

Link to comment
Share on other sites

You would not like my 'different approach' suggestion.

 

Attach a copy of the misbehaving drawing to your next post. Someone here will take a look at it. Maybe they will have better luck.

Link to comment
Share on other sites

ReMark,

I found a way to work around the macro you provided and after a couple of "trial and errors" a came to the desired result.

Your previous suggestion works and for this I own you an apology.

Thanks.

Link to comment
Share on other sites

I use this one which I created YEARSSSSS ago

Still working fine for me :)

 

 

(defun c:Z-coord ( )
(graphscr)
(princ "\nATTENTION !!!  Do NOT use this routine on a 3D-drawing !!!")
(initget "y Y n N")
(setq sure (getkword "\nAre you sure you want to move all Z-coِordinates to 0.000 ? (Y/N) <N>:"))
(setq sure (strcase sure))
(if (= sure "")
    (setq sure "N")
)
(if (= sure "Y")
    (progn
	(initget "y Y n N")
	(setq reallysure (getkword "\nAre you REALLY sure ? (Y/N) <N>: "))
	(setq reallysure (strcase reallysure))
	(if (= reallysure "")
	    (setq reallysure "N")
)   )	)
(if (= reallysure "Y")
    (progn
	(setq zasnw 0.0)
	(if (setq selectie (ssget "x"))
	    (progn
		(setq aantent (sslength selectie))
		(setq teller 0)
		(while (< teller aantent)
		    (setq startlijst nill)
		    (setq endlijst nill)
		    (setq elevlijst nill)
		    (setq diktelijst nill)
		    (setq volg nill)
		    (setq entnaam (ssname selectie teller))
		    (setq teller (1+ teller))
		    (setq entlijst (entget entnaam))
		    (setq startlijst (assoc 10 entlijst))
		    (setq endlijst (assoc 11 entlijst))
		    (setq elevlijst (assoc 38 entlijst))
		    (setq diktelijst (assoc 39 entlijst))
		    (setq volg (cdr (assoc 66 entlijst)))
		    (setq xstart (cadr startlijst))
		    (setq ystart (caddr startlijst))
		    (setq xend (cadr endlijst))
		    (setq yend (caddr endlijst))
		    (setq startnw (list '10 xstart ystart zasnw))
		    (setq endnw (list '11 xend yend zasnw))
		    (setq elev (cons '38 zasnw))
		    (setq dikte (cons '39 zasnw))
		    (setq entlijst (subst startnw startlijst entlijst))
		    (entmod entlijst)
		    (entupd entnaam)
		    (if (not (= endlijst nil))
			(progn
			    (setq entlijst (subst endnw endlijst entlijst))
			    (entmod entlijst)
			    (entupd entnaam)
		    )	)
		    (if (not (= elevlijst nil))
			(progn
			    (setq entlijst (subst elev elevlijst entlijst))
			    (entmod entlijst)
			    (entupd entnaam)
		    )	)
		    (if (not (= diktelijst nil))
			(progn
			    (setq entlijst (subst dikte diktelijst entlijst))
			    (entmod entlijst)
			    (entupd entnaam)
		    )	)
		    (if (= volg 1)
			(progn
			    (setq entnaam1 (entnext entnaam))
			    (while (= volg 1)
				(setq startlijst nill)
				(setq endlijst nill)
				(setq elevlijst nill)
				(setq diktelijst nill)
				(setq volg nill)
				(setq entlijst (entget entnaam1))
				(setq startlijst (assoc 10 entlijst))
				(setq endlijst (assoc 11 entlijst))
				(setq elevlijst (assoc 38 entlijst))
				(setq diktelijst (assoc 39 entlijst))
				(setq volg (cdr (assoc 66 entlijst)))
				(if (not (= startlijst nil))
				    (progn
					(setq xstart (cadr startlijst))
					(setq ystart (caddr startlijst))
					(setq startnw (list '10 xstart ystart zasnw))
					(setq entlijst (subst startnw startlijst entlijst))
					(entmod entlijst)
					(entupd entnaam1)
				)   )
				(if (not (= endlijst nil))
				    (progn
					(setq xend (cadr startlijst))
					(setq yend (caddr startlijst))
					(setq endnw (list '10 xend yend zasnw))
					(setq entlijst (subst endnw endlijst entlijst))
					(entmod entlijst)
					(entupd entnaam1)
				)   )
				(if (not (= elevlijst nil))
				    (progn
					(setq entlijst (subst elev elevlijst entlijst))
					(entmod entlijst)
					(entupd entnaam1)
				)   )
				(if (not (= diktelijst nil))
				    (progn
					(setq entlijst (subst dikte diktelijst entlijst))
					(entmod entlijst)
					(entupd entnaam1)
				)   )
				(if (= volg 1)
				    (setq entnaam1 (entnext entnaam1))
)   )	)   )	)   )	)   )	)
(setvar "attreq" 1)
(princ)
)

  • Agree 1
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...