Author Topic: Intersecting with a Civil 3D Surface  (Read 4966 times)

0 Members and 1 Guest are viewing this topic.

jmcshane

  • Newt
  • Posts: 83
Intersecting with a Civil 3D Surface
« on: May 18, 2010, 12:38:23 PM »
Hi all,

I'm not sure even how to phrase this question without making it sound to long winded,but here goes:

I have a utility survey (gas mains, watermains, telecoms etc.) which is made up of 3D polylines.
The problem I have is that they are relating to a datum of 0, so that the Z value of each vertice
is really only the depth below ground at that particular point.

What I need to do is raise each polyline so that it is draped onto the surface and then lower
each line to the correct depth below the surface (its current Z value)

While I can get a list of all the coordinates of each 3DPolyline,
I don't know how to interact with the Civil 3D surface.

Any directions, advice would be most welcome.

John
John.

Civil 3D 2021. Windows 10

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Intersecting with a Civil 3D Surface
« Reply #1 on: May 18, 2010, 01:58:35 PM »
The simplest method would be to select the Surface and convert it to a (vlax-object). Then you can use the surface's method: FindElevationAtXY.

Assuming you have obtained the surface and set it to the variable workingSurf:
Code: [Select]
(setq pt (getpoint "\nPick point to extract surface elevation: "))
 (setq elev (vlax-invoke workingSurf 'FindElevationAtXY (car pt) (cadr pt)))
 ;;do whatever with the elevation

jmcshane

  • Newt
  • Posts: 83
Re: Intersecting with a Civil 3D Surface
« Reply #2 on: May 19, 2010, 11:14:58 AM »
Many Many thanks Jeff.

I would never have found that one.

John
John.

Civil 3D 2021. Windows 10

butzers09silverado

  • Guest
Re: Intersecting with a Civil 3D Surface
« Reply #3 on: May 25, 2010, 01:11:14 PM »
couldn't you create a profile of the utility, make a surface, and then paste it into your proposed composite surface?

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Intersecting with a Civil 3D Surface
« Reply #4 on: May 25, 2010, 01:18:34 PM »
In 'honor' of this thread, I added this option to my DistanceInquiry.LSP.
http://www.theswamp.org/index.php?topic=30416.0



I also put this one together:
Code: [Select]
(defun c:SEI (/ pt elev)
  ;; Surface Elevation Inquiry
  ;; Extract elevation from point in Civil 3D surface
  ;; Required subroutine: AT:Entsel
  ;; Alan J. Thompson, 05.25.10
  (if (setq *SEI:Surface*
             (cond ((AT:Entsel nil
                               (strcat "\nSelect surface"
                                       (if *SEI:Surface*
                                         (strcat " <Previously selected: \""
                                                 (vla-get-name *SEI:Surface*)
                                                 "\">: "
                                         )
                                         ": "
                                       )
                               )
                               '("V" (0 . "AECC_TIN_SURFACE"))
                               nil
                    )
                   )
                   (*SEI:Surface*)
             )
      )
    (while (setq pt (getpoint (strcat "\nSpecify point on surface \""
                                      (vla-get-name *SEI:Surface*)
                                      "\": "
                              )
                    )
           )
      (setq pt (trans pt 0 1))
      (if (> (setq elev (vlax-invoke *SEI:Surface* 'FindElevationAtXY (car pt) (cadr pt)))
             -99999.9
          )
        (princ (strcat "\nSelected elevation: " (vl-princ-to-string elev)))
        (princ "\nPoint outside of surface!")
      )
    )
  )
  (princ)
)

Can be easily modified to remove usage, but you'll need this sub:
http://www.theswamp.org/index.php?topic=30189.0
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

jmcshane

  • Newt
  • Posts: 83
Re: Intersecting with a Civil 3D Surface
« Reply #5 on: May 26, 2010, 06:22:59 AM »
Quote
couldn't you create a profile of the utility, make a surface, and then paste it into your proposed composite surface?
To be perfectly honest, I'm not that proficent with Civil yet, still trying to get my head around a lot of it.
And I needed something quick. So with Jeff's help, I can now get the whole lot done in a matter of seconds.

They are some nice routines Alan. Thanks for sharing.


John.

Civil 3D 2021. Windows 10

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Intersecting with a Civil 3D Surface
« Reply #6 on: May 26, 2010, 08:19:03 AM »
They are some nice routines Alan. Thanks for sharing.
Thanks and you're welcome. :)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

NickMerchant

  • Guest
Re: Intersecting with a Civil 3D Surface
« Reply #7 on: November 11, 2010, 10:47:29 AM »
Hi Jeff,

Are you sure this method still works within C3D 2010? I'd been using it in my 3rd party app' for years, but suddenly a client of mine started using 2010 and the method is no longer returning elevations. But it worked fine up to 2009. My app' is able to retrieve the list of defined surfaces, so I know I'm using the correct application object, "AeccXUiLand.AeccApplication.7.0". I'll be debugging this in the next couple of days to get to the heart of the problem, but I thought I'd check with you first to see if you'd actually TESTED that method in 2010.


The simplest method would be to select the Surface and convert it to a (vlax-object). Then you can use the surface's method: FindElevationAtXY.

Assuming you have obtained the surface and set it to the variable workingSurf:
Code: [Select]
(setq pt (getpoint "\nPick point to extract surface elevation: "))
 (setq elev (vlax-invoke workingSurf 'FindElevationAtXY (car pt) (cadr pt)))
 ;;do whatever with the elevation


Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Intersecting with a Civil 3D Surface
« Reply #8 on: November 11, 2010, 12:14:24 PM »
Hi Jeff,

Are you sure this method still works within C3D 2010?

Yep, I know it still works just fine in 2010...in 2011, too.

drizzt

  • Guest
Re: Intersecting with a Civil 3D Surface
« Reply #9 on: November 11, 2010, 12:22:53 PM »
why can't you copy the 3dpoly (if you need to keep the elevations of it) then "create feature line from object and assign elevations from a surface. Not sure how you would code this in lisp, but the tool seems to be already there.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Intersecting with a Civil 3D Surface
« Reply #10 on: November 11, 2010, 12:23:52 PM »
Hi Jeff,

Are you sure this method still works within C3D 2010?

Yep, I know it still works just fine in 2010...in 2011, too.
Good to know.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox