Author Topic: LDD Surface Elevation Value to Block  (Read 4437 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« on: February 02, 2005, 04:05:47 PM »
Our Lot Grading Plans shows elevations along the proposed centerline of road over set intervals. Our grading requirements for dirt pad elevation is based on centerline elevation directly in front of the lot. Is it possible to extract the elevation from a proposed surface elevation and have that value applied to a user defined block with an attribute.

psuedo code:
-User selects surface point in front of lot
-Elevation applied to Block
-Prompt for insertion point of block (rotation, scale, etc.)

This could save us a lot (pun intended?) of time...

Thanks,
Dan

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
LDD Surface Elevation Value to Block
« Reply #1 on: February 02, 2005, 04:37:07 PM »
If you have the road defined as an alignment with a FG profile you can do this rather quickly & accurately.

If you want to get the elevation from a surface, remember that these elevations are only as good as the TIN. These elevations can also be retrieved easily, but IMHO are not as accurate as the first.

I wrote a VBA macro that labels points and allows you to select a point at the lot corner, which is always the same distance fom the Top of Curb, and calcs the grade at that point.....cross slope, gutter depth,curb height are all accounted for, if needed.

I can post this if interested.

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #2 on: February 02, 2005, 04:49:58 PM »
Yes, roadways are defined with FG profile.

The TIN is created from breaklines offset through various means (distances, slopes, elevations) and has been accurate enough to this point.

For now I am labeling spot elevations from  Terrain >> Surface Utilities >> Label Spot Elevations >> this gives me text with the desired elevation. I have a LISP that extracts that text string and inserts into a Block. Next I run a LISP that adds value (12", 17") to the block attribute for dirt pad or FF elevations. I was hoping to run all this together into one command, however I'm not sure how to extract the initial elevation data the way LDD is for the labels.

If you care to share the Macro you wrote I would like at least have a look and another approach to a similar situation.

Dan

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
LDD Surface Elevation Value to Block
« Reply #3 on: February 02, 2005, 05:45:54 PM »
Here's a quick example of how to access the Surface elevations. You can incorporate this with your lisp(s) to get a finalized, single lisp, solution.
Code: [Select]

(defun C:Pt_surf (/ acadobj aecapp aecProj aecsurfs aecsurf aecutil e-n emsg pt# selev)
  (setq acadObj  (vlax-get-acad-object)
   aecApp  (vla-getinterfaceobject acadObj "Aecc.Application")
   aecProj (vlax-get aecApp "Activeproject")
   aecSurfs (vlax-get aecProj "Surfaces")
   aecSurf (vlax-get aecSurfs "Currentsurface")
   aecUtil (vlax-get (vlax-get aecApp "activedocument") "Utility")
   )
  (if (and (= aecSurf "")
      (> (vlax-get aecSurfs "count") 0)
      )
    (setq aecSurf (vlax-get (vlax-invoke aecSurfs "item" 0) "name"))
    )
  (if (= aecSurf "")
    (princ "\nNo surfaces defined, try again after creating a surface.")
    (progn
      (setq aecSurf (vlax-invoke aecSurfs "item" aecSurf))
      (while (setq pt# (getpoint "\nPoint to label on the current surface: "))
   (setq e-n (vlax-invoke aecutil "xytoeastnorth" pt#))
   (setq selev (vlax-invoke aecSurf "getelevation" (car e-n) (cadr e-n)))
   (princ (strcat "\nElevation at point = " (rtos selev)))
   )
      )
    )
  (setq objList (reverse '(acadobj aecapp aecProj aecsurfs aecsurf aecutil)))
  (setq emsg (vl-catch-all-apply 'vlax-release-object 'objlist))
  (vl-catch-all-error-message emsg)
  (princ)
  )

I'll post a link in a few minutes where you can get a copy of my station labeling routine.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
LDD Surface Elevation Value to Block
« Reply #4 on: February 02, 2005, 05:49:42 PM »
Here's the link to My Sta-Off-Lbl2.dvb file

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #5 on: February 03, 2005, 07:35:01 AM »
Thanks for the feedback, I"ll see what I can put together with this piece of code.

Dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
LDD Surface Elevation Value to Block
« Reply #6 on: February 03, 2005, 07:51:21 AM »
When you say "User selects surface point in front of lot " are you referring to an AECC point? Or point on the surface?
TheSwamp.org  (serving the CAD community since 2003)

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #7 on: February 03, 2005, 12:59:51 PM »
This would be "User selects point (as in location) on the surface" NOT a Civil Point (Object) or AECC point. Sorry if this wasn't clear.

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #8 on: February 04, 2005, 09:14:23 AM »
Jeff_M, I modified the first line of code:

Code: [Select]
(defun c:Ptsurf (/ acadobj aecapp aecsurfs aecsurf aecutil e-n emsg pt# selev)

I wanted to see if I could replicate the spot label similar to the LDD command. I receieve a NIL error when selecting a point location on my test surface, any ideas? I won't pretend to fully understand the code you gave me but was hoping I could see it working then revise parts to combine with my other lisp(s). Ultimately this would give me one lisp for this part of my lot grading plans.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
LDD Surface Elevation Value to Block
« Reply #9 on: February 04, 2005, 10:21:04 AM »
DanB, my first thought was that you didn't select a point with the surface. If you comment out the local var declarartions:
Code: [Select]
(defun c:Ptsurf (/ ) ;acadobj aecapp aecsurfs aecsurf aecutil e-n emsg pt# selev) then you will be able to inspect the values stored in the vars. The first one I'd check is "selev" like so:
Command: !selev
If it's nil then the point does not lie on the surface.

I'll be out all day today surveying, so if I don't get back to you until tomorrow, don't be alarmed.....

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #10 on: February 04, 2005, 12:55:59 PM »
I have created a "test" project that contains a small TIN. I am able to label spot elevations through LDD within the surface boundary. I then load up the PTSURF lisp (with the modified first line c:ptsurf). The following occurs:

Command: PTSURF
*Cancel*
bad argument type: VLA-OBJECT nil

I am never prompted to select a point location rather it doesn't seem to recognize that there is a Current Surface available.

Also after commenting out (is that a phrase?) the local var declarations:

Command: !selev
nil

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
LDD Surface Elevation Value to Block
« Reply #11 on: February 04, 2005, 10:11:07 PM »
OK, so I ripped that code out of a bigger lisp and pared it down for this example.......and I might've been a tad hasty :( I removed the reference to the active project.....oops

So I modified the code in my original post and verified that it does work. Sorry 'bout that! Copy the new code and it should work just fine now.

DanB

  • Bull Frog
  • Posts: 367
LDD Surface Elevation Value to Block
« Reply #12 on: February 07, 2005, 09:39:19 AM »
Jeff_M,

I appreciate the follow-up, I'll copy out the code and give it a run when I get a spare minute here at work. I'll post my progress here with any updates.

Thanks,
Dan