Jump to content

Remove Z (depth) attributes from object


TheRobster

Recommended Posts

Hi,

 

I am working on the design of a surface water drainage system for a commercial development and have been given plans of the site that were generated using the Key Terra Firma software. The problem I am having is that much of the drawing has x, y and z coordinate data (length, width and depth) but I am really only interested in working out the surface areas of various parts of the development. Basically I don't need the z (depth) data and would like to remove it and only leave the x and y coordinates behind (but without affecting the layout at all).

 

Is there anyway to do this? Ideally there would be an option where I just select the whole drawing and click a button labelled "remove all z data" which just resets all z values to zero.

 

How can I do this?

 

Cheers

-Rob

Link to comment
Share on other sites

Ah, got it.

 

I actually did a search of the forum but neglected to just look down the list of current topics (didn't think I'd be that lucky to have a similar post so recently....) :oops:

Link to comment
Share on other sites

  • 3 years later...
Ah, got it.

 

I actually did a search of the forum but neglected to just look down the list of current topics (didn't think I'd be that lucky to have a similar post so recently....) :oops:

 

 

I have done a search and have found nothing.

 

Could somebody show me how to do this? I basically just want to flatten the dwg I see for presentation purposes only.

Link to comment
Share on other sites

From the properties dialog, could you not 0 out the Z there.

It doesnt let me do that it is greyed out and I cannot edit the x.y or z attributes for the properties box.

Link to comment
Share on other sites

I am sorry, I did not fully understand what you were trying to do. I will keep looking into this and see what I can find for you.

Link to comment
Share on other sites

I have a drawing that I would like to import into another application, but because the dwg has a 'depth' it does not import correctly. I would like to remove all attributes of depth (z) and keep what I see on the screen as a 2 dimensional image.

Link to comment
Share on other sites

Flatten Command doesnt do anything for me. The response I get is "Unknown command "FLATTEN". Press F1 for help." :(

Link to comment
Share on other sites

I think that LT does not have Lisp, so you will have to do it manually.

 

First of all , make a copy of your drawing and practise on the copy. Then start the Move command, select ALL, then the base point is picked anywhere in the drawing, and the displacement is @0,0,1e99. You have not finished yet - there is more. Now repeat the Move, select ALL, and the base point is picked anywhere, and the displacement this time is @0,0,-1e99.

 

If there are any 3D blocks, then they will not be flattened, otherwise everything will have a z value of 0, and all done without Lisp :D

Link to comment
Share on other sites

I think that LT does not have Lisp, so you will have to do it manually.

 

First of all , make a copy of your drawing and practise on the copy. Then start the Move command, select ALL, then the base point is picked anywhere in the drawing, and the displacement is @0,0,1e99. You have not finished yet - there is more. Now repeat the Move, select ALL, and the base point is picked anywhere, and the displacement this time is @0,0,-1e99.

 

If there are any 3D blocks, then they will not be flattened, otherwise everything will have a z value of 0, and all done without Lisp :D

 

I tried this and the end result was a bunch of dots all over the screen and no real image. Thanks anyway, Ive traced the image and just used that.

Link to comment
Share on other sites

I tried this and the end result was a bunch of dots all over the screen and no real image.

 

I wonder what was in the drawing :? Could you post a snippet of the drawing so that I could find out what is going on?

Link to comment
Share on other sites

Here's a lisp routine I wrote many years ago that sets all the selected items Z to 0

Hope it helps.

 

; sets all entities to 0.0 on the z axis

(defun c:fixz (/ ed mysel total count cur_ent curtype as1 as2 ptx1 ptx2 pty1 pty2 ptz1 ptz2 oldpt newpt )

(setq mysel (ssget))

(setq total (sslength mysel))

(setq count 0)

(while (

(setq cur_ent (ssname mysel count))

(setq ed (entget cur_ent))

(setq curtype (cdr (assoc '0 ed)))

(if (= curtype "LINE")

(progn

(setq as1 (assoc '10 ed))

(setq as2 (assoc '11 ed))

(setq ptx1 (cadr as1))

(setq ptx2 (cadr as2))

(setq pty1 (caddr as1))

(setq pty2 (caddr as2))

(setq ptz1 (cadddr as1))

(setq ptz2 (cadddr as2))

(setq oldpt (list '10 ptx1 pty1 ptz1))

(setq newpt (list '10 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

(setq oldpt (list '11 ptx2 pty2 ptz2))

(setq newpt (list '11 ptx2 pty2 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

(if (or (= curtype "MTEXT") (= curtype "TEXT"))

(progn

(setq as1 (assoc '10 ed))

(setq ptx1 (cadr as1))

(setq pty1 (caddr as1))

(setq ptz1 (cadddr as1))

(setq oldpt (list '10 ptx1 pty1 ptz1))

(setq newpt (list '10 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

(if (or (= curtype "ARC") (= curtype "CIRCLE") (= curtype "ELLIPSE"))

(progn

(setq as1 (assoc '10 ed))

(setq ptx1 (cadr as1))

(setq pty1 (caddr as1))

(setq ptz1 (cadddr as1))

(setq oldpt (list '10 ptx1 pty1 ptz1))

(setq newpt (list '10 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

(if (= curtype "DIMENSION")

(progn

(setq as1 (assoc '13 ed))

(setq as2 (assoc '14 ed))

(setq ptx1 (cadr as1))

(setq ptx2 (cadr as2))

(setq pty1 (caddr as1))

(setq pty2 (caddr as2))

(setq ptz1 (cadddr as1))

(setq ptz2 (cadddr as2))

(setq oldpt (list '13 ptx1 pty1 ptz1))

(setq newpt (list '13 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

(setq oldpt (list '14 ptx2 pty2 ptz2))

(setq newpt (list '14 ptx2 pty2 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

(if (= curtype "POLYLINE")

(progn

(setq as1 (assoc '10 ed))

(setq ptx1 (cadr as1))

(setq pty1 (caddr as1))

(setq ptz1 (cadddr as1))

(setq oldpt (list '10 ptx1 pty1 ptz1))

(setq newpt (list '10 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

(if (or (= curtype "LEADER") (= curtype "SPLINE"))

(progn

(setq as1 (assoc '10 ed))

(setq ptx1 (cadr as1))

(setq pty1 (caddr as1))

(setq ptz1 (cadddr as1))

(setq oldpt (list '10 ptx1 pty1 ptz1))

(setq newpt (list '10 ptx1 pty1 '0.0))

(setq ed (subst newpt oldpt ed))

(entmod ed)

)

)

 

(setq count (1+ count))

)

)

Link to comment
Share on other sites

  • 6 years later...
First of all , make a copy of your drawing and practise on the copy. Then start the Move command, select ALL, then the base point is picked anywhere in the drawing, and the displacement is @0,0,1e99. You have not finished yet - there is more. Now repeat the Move, select ALL, and the base point is picked anywhere, and the displacement this time is @0,0,-1e99.

 

If there are any 3D blocks, then they will not be flattened, otherwise everything will have a z value of 0, and all done without Lisp

 

Best tip in a long time.

 

Great help.

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