Monday, March 12, 2012

A Quick Way to Flatten Survey Figures and Feature Lines

Something that comes up quite a bit for me is a good way to flatten survey figures and feature lines so that they occupy elevation zero.  Why do this?  For some, its just a preference to work in a 2D environment.  Whether this is good or bad could be argued extensively in another post, but I'll leave that for another day.  Another reason is so that linetype generation can be respected so that utility lines, fence lines, and other special linetypes display properly.

It's not the most eloquent solution but I whipped up this LISP routine that I call STEAMROLLER and it works pretty well.  It will convert all (as in every one in the entire drawing) survey figures, feature lines, and 3D polylines to 2D polylines at elevation zero, and and turn the lintype generation feature ON.  Just wanted to share:


(defun C:STEAMROLLER ()
  (setvar "CMDECHO" 0)
  (setvar "qaflags" 1)
  (if (setq C3DOBJ (ssget "X" '((0 . "AECC_SVFIGURE*"))))
    (command "explode" C3DOBJ "" "AeccConvert3dPolys" "P" "")
  )
  (if (setq C3DOBJ (ssget "X" '((0 . "AECC_FEATURE_LINE*"))))
    (command "explode" C3DOBJ "" "AeccConvert3dPolys" "P" "")
  )
  (if (setq C3DOBJ (ssget "X" '((0 . "POLYLINE*"))))
    (command "AeccConvert3dPolys" C3DOBJ "")
  )
  (if (setq C3DOBJ (ssget "X" '((0 . "LWPOLYLINE*"))))
    (command "CHANGE" C3DOBJ "" "P" "ELEV" "0" "" "PEDIT" "M" "P" "" "L" "ON" "")
  )
  (setvar "qaflags" 0)
  (setvar "CMDECHO" 1)
)

6 comments:

  1. Just used this for a massive existing conditions survey we are doing. Works great!! Didn't loose the contours either.

    ReplyDelete
  2. Excellent work! I love it when I google something and find exactly what I needed. You rock bro!

    ReplyDelete
  3. Do you have a way to apply this command to a selection of survey figures instead of all of them?

    ReplyDelete
  4. If you remove the "_X" it will force you to select the window area, but it will do it for each of the if statements.
    My question pertains to a little more detail, have you found a way to do this and maintain arcs, as opposed to short polyline segments where curves were before in the survey figures.

    ReplyDelete
    Replies
    1. That is the main drawback- arcs get exploded into a series of line segments, instead of maintaining the original arc. It's a lot of work drafting all the arcs in 2D again....almost takes away from the benefit of the steamroller command.

      Delete
  5. Should there be another persuasive post you can share next time, I’ll be surely waiting for it. paid surveys

    ReplyDelete