PDA

View Full Version : Remove Z (depth) attributes from object



TheRobster
22nd Jan 2006, 05:56 pm
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

CarlB
22nd Jan 2006, 07:05 pm
This has been discussed many times, most recently yesterday. See the post by bpjewell 1/21/06. Let us know how it goes.

TheRobster
22nd Jan 2006, 08:10 pm
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:

webster
12th May 2009, 02:54 am
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.

The Buzzard
12th May 2009, 03:38 am
From the properties dialog, could you not 0 out the Z there.

webster
12th May 2009, 03:40 am
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.

The Buzzard
12th May 2009, 03:47 am
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.

The Buzzard
12th May 2009, 03:54 am
I believe where a block is concerned, To this you will need a lisp program.

webster
12th May 2009, 03:57 am
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.

The Buzzard
12th May 2009, 03:58 am
There is a program on this thread on post 9. Check it out.


http://www.cadtutor.net/forum/showthread.php?t=2711&highlight=Flatten+attributes

The Buzzard
12th May 2009, 04:03 am
Here is another.

http://www.cadtutor.net/forum/showthread.php?t=2213&highlight=Flatten+attributes

webster
12th May 2009, 05:52 am
Flatten Command doesnt do anything for me. The response I get is "Unknown command "FLATTEN". Press F1 for help." :(

The Buzzard
12th May 2009, 07:47 am
Sorry I Tried To Help
NOT SURE, BUT LEARN LISP.

eldon
12th May 2009, 08:48 am
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

Lee Mac
12th May 2009, 01:41 pm
Nice tip Eldon, -- I was about to recommend the flatten LISP in our Archive here - but LT is sooo annoying...

webster
13th May 2009, 01:07 am
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.

eldon
13th May 2009, 08:27 am
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?

Fish103
19th May 2009, 08:56 pm
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 (< count total)
(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))
)
)