Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting all lines to 0 Elevation?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
mwadkins12
9750 Views, 5 Replies

Setting all lines to 0 Elevation?

Okay, I am new to Civil 3d (we are trying to make the move from Land Desktop to Civil 3d) and I have already came across a snag. Esscentially, I get yard drawings from customers that I have to use and I have noticed that there are several different entities at different elevations (when looking at it from the front view). Is there a way to flatten all of these lines (and entities) to zero elevation? I have tried the FLATTEN command (which didn't work), tried opening the elevation editor (which the entities that I have are not part of this), as well as a could other things that I have found on the internet. So far, I have not been able to get this to work (without manually setting the "Y" value to zero for each individual line); all I need is a 2d setup here with everything on one plane.

 

Is there a way to get this done via something that I have over looked, LISP, or some other method?

5 REPLIES 5
Message 2 of 6
sboon
in reply to: mwadkins12

If all of the entities are simple lines then you should be able to select all of them and use the properties dialog to set their endpoint Z values to zero.

 

One of the important things to consider when transitioning from LDT to C3D is the fact that Z values matter in this software.  If those lines and entities are part of a surface model and you change them then the surface will be broken.  You need to start considering how to incorporate 3d into your drafting process if you want to be successful with C3d.

 

Steve
Please use the Accept as Solution or Kudo buttons when appropriate

 

Steve
Expert Elite Alumnus
Message 3 of 6
jmayo-EE
in reply to: mwadkins12

As Steve noted you may want to consider copying the data you need in 2d to a new file. We still do this because working with the 3d data doesn't work well for many things we do for our plans. Boundaries, hatches, NCopies, etc. all fail. We have all 2d basemaps and 3d models are kept in separate files.

 

With the Elevation editor you should be able to select all columns and type 0 into on elevation field. The other Z's should follow suit. This works with Flines, parcel segments & Figures.

 

Sometimes with Acad data I select it all on screen and go to the properties dialog. I use the filter drop down to individually assign 0 to all blocks, lines, arcs, plines in a few clicks.

 

I use Flatten to sometimes but I have to isolate ACAD block definition out of the selection. If you have 100 blocks maned MH you will wind up with 100 new block definitions MH-flat-1, MH-flat-2, MH-flat-3 all the way to MH-flat-100.

John Mayo

EESignature

Message 4 of 6
tcorey
in reply to: mwadkins12

It would be easy enough to write a lisp routine to do this, but we would need to know what object types you're dealing with. Post a drawing.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 5 of 6
mwadkins12
in reply to: tcorey

This is what I am normally given. We really don't use Land Desktop (or Civil 3d) for their intended purposes; mainly for product installation. However, we do need a couple of the tools housed by LD and Civil 3d which is why we are not doing everything in AutoCAD. Honestly, I'm an Inventor and 3ds Max guy; all of this just got dumped into my lap.

Message 6 of 6
tcorey
in reply to: mwadkins12

Try the following LISP code. It does not fix the objects that are not parallel to the world ucs.

;copyright 2014 by Timothy Corey, Delta Engineering Systems, Redding, CA
;permission is hereby granted for free use of the following code with or without
;modification. Code may not be sold or included in any commercial software for sale.

;This program moves all objects to 0 elevation, then comes back through and updates line endpoints
;and 3D polyline vertices to 0 elevation
;this routine does not modify objects that are not parallel to the ucs.


(defun c:go (/ all lines len ctr lin p1 p2 p1x p1y p2x p2y linx newp1xyz newp2xyz linx pls subent subentx vtx vty vtxyz newvtxyz)
  (vl-load-com)
  (setq all (ssget "ALL"))

  (vl-cmdf "Change" all "" "P" "E" 0 "")


  (setq lines (ssget "x" (List (cons 0 "LINE")))
	len (sslength lines)
	ctr 0)

  (while (< ctr len)
    (setq lin (ssname lines ctr)
	  p1 (cdr (assoc 10 (entget lin)))
	  p2 (cdr (assoc 11 (entget lin)))
	  p1x (car p1)
	  p1y (cadr p1)
	  p2x (car p2)
	  p2y (cadr p2)
	  )
    (setq linx (entget lin))
    (setq newp1xyz (list p1x p1y 0)
	  newp2xyz (list p2x p2y 0)
	  )

    (setq linx (subst (cons 10 newp1xyz)
		      (assoc 10 linx)
		      linx)
	  )
    (setq linx (subst (cons 11 newp2xyz)
		      (assoc 11 linx)
		      linx)
	  )
    (entmod linx)
    (entupd lin)
    (setq ctr (1+ ctr))
    );end while

  (setq pls (ssget "x" (list (cons 100 "AcDb3dPolyline")))
	len (sslength pls)
	ctr 0)

  (while (< ctr len)
    (setq pl (ssname pls ctr))
    (if (= (cdr (assoc 0 (entget pl))) "POLYLINE")
      (progn
    (setq subent (entnext pl))

    (while (not (= (cdr (assoc 0 (entget subent))) "SEQEND"))

      (setq vtxyz (cdr (assoc 10 (entget subent)))
	    vtx (car vtxyz)
	    vty (cadr vtxyz)
	    )
      (setq newxyz (list vtx vty 0))
      (setq subentx (entget subent))
      (setq subentx (subst (cons 10 newxyz)
			   (assoc 10 subentx)
			   subentx)
	    )
         (entmod subentx)
         (entupd subent)
      

      (setq subent (entnext subent))
      );end while
    );end progn
      );end if
    (setq ctr (1+ ctr))
    );end while
  (vl-cmdf "REGEN")
  (princ)
  );end defun

 Tim

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report