Author Topic: Civil 3D Inquiry Tool & Labels  (Read 20842 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Civil 3D Inquiry Tool & Labels
« on: July 27, 2012, 09:04:19 AM »
In plan view, how does one query a pipe (part) for the invert elevation by user specified point?

Also, I know that Civil 3D can query any given Station & Offset by point (using the Inquiry Tool), so why must I select the same point twice when adding an Alignment Label (i.e., _AeccAddAlignOffLbl Command:? ?
« Last Edit: July 27, 2012, 09:09:40 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #1 on: July 27, 2012, 09:30:49 AM »
In plan view, how does one query a pipe (part) for the invert elevation by user specified point?

Another awesome Autodesk AECC* enhancement:

Code - Auto/Visual Lisp: [Select]
  1. Command: (_dump (vla-get-startpoint (vlax-ename->vla-object (car (entsel))))) ; <- I selected an AECC_PIPE
  2.  
  3. Select object: ; Object does not support ITypeInfo interface
  4.  
  5. ** Invalid argument: Must be VLA-OBJECT **
  6.  

... If I can't even view the Properties & Methods available for the StartPoint Property Object, then I certain cannot code my own Visual LISP function, without some .NET LispFunction assistance.
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D Inquiry Tool & Labels
« Reply #2 on: July 27, 2012, 01:23:38 PM »
In plan view, how does one query a pipe (part) for the invert elevation by user specified point?

there is no way that I am aware of....not even with a(n) expression as the information one needs
like pipe station, or instantaneous grade, slope, elevation is not available to use in a formula.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D Inquiry Tool & Labels
« Reply #3 on: July 27, 2012, 01:25:47 PM »

Also, I know that Civil 3D can query any given Station & Offset by point (using the Inquiry Tool), so why must I select the same point twice when adding an Alignment Label (i.e., _AeccAddAlignOffLbl Command:? ?
Use the Station and Offset _ Fixed Point command instead.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #4 on: July 27, 2012, 01:28:15 PM »
In plan view, how does one query a pipe (part) for the invert elevation by user specified point?

there is no way that I am aware of....not even with a(n) expression as the information one needs
like pipe station, or instantaneous grade, slope, elevation is not available to use in a formula.

Thanks for the confirmation.


Also, I know that Civil 3D can query any given Station & Offset by point (using the Inquiry Tool), so why must I select the same point twice when adding an Alignment Label (i.e., _AeccAddAlignOffLbl Command:? ?
Use the Station and Offset _ Fixed Point command instead.

Doh! Early on, I set an alias to use the non-fixed command, to avoid having to go to another tab, the pulldown ribbon button, flyout, etc.. I'll update my alias accordingly. Thanks!  :lol:
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #5 on: July 27, 2012, 01:42:32 PM »
In plan view, how does one query a pipe (part) for the invert elevation by user specified point?

there is no way that I am aware of....not even with a(n) expression as the information one needs
like pipe station, or instantaneous grade, slope, elevation is not available to use in a formula.

Thanks for the confirmation.

Perhaps I can employ the GetClosestPointTo() Method found in the Autodesk.Civil.PipeNetwork.DatabaseServices.Pipe Class... I'll check out the Civil 3D & ObjectARX 2011 code samples before rolling my own CommandMethod.  :kewl:

... Just wanted to make sure I wasn't missing a built-in option.

Cheers, Michael! :beer:
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D Inquiry Tool & Labels
« Reply #6 on: July 27, 2012, 01:55:48 PM »
please keep me abreast of the result of this

otherwise just send me some breasts
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #7 on: July 27, 2012, 02:12:17 PM »
please keep me abreast of the result of this

otherwise just send me some breasts

Sure thing, I'll just get something off the rack! :lmao:
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #8 on: July 30, 2012, 09:31:42 PM »
Update:

I have a working draft for my CommandMethod, which prompts the user to first select a pipe ("AECC_PIPE"), then a point along the pipe, which successfully returns a Point3D to the Command Line for verification.

Currently, the point that is returned is not the invert (flow line), but appears to be the outside of pipe (top?) in the limited testing I've done (just got this working 2 mins ago). So I need to find the correct way of extracting the pipe invert next.

More work is needed, as I would like to make this a single point selection (no prompting the user to select the pipe first), and loop the point selection. I also need to implement some basic Exception handling, and then I think I'm ready to post.
« Last Edit: July 30, 2012, 10:35:46 PM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4093
  • C3D user & customizer
Re: Civil 3D Inquiry Tool & Labels
« Reply #9 on: July 31, 2012, 12:15:29 AM »

Currently, the point that is returned is not the invert (flow line), but appears to be the outside of pipe (top?) in the limited testing I've done (just got this working 2 mins ago). So I need to find the correct way of extracting the pipe invert next.
This should be the center of pipe elevation. You'd then use 1/2 the InnerDiameterOrWidth property to determine the invert. This can all be done in lisp, btw. You just need to use the Curve class methods (not the vlax-curve-* lisp stuff, they fail). Here's a quick function to get a point at the specified parameter:
Code: [Select]

(defun getparam (pipe param)
  (vlax-safearray->list
    (vlax-variant-value
      (vlax-get-property pipe 'pointatparam param)
      )
    )
  )
 
(setq end0 (getparam pipe 0.0)
          end1 (getparam pipe 1.0)
)
« Last Edit: July 31, 2012, 12:20:41 AM by Jeff_M »

Jeff_M

  • King Gator
  • Posts: 4093
  • C3D user & customizer
Re: Civil 3D Inquiry Tool & Labels
« Reply #10 on: July 31, 2012, 12:19:36 AM »
Oh, but you can get fancier with a .NET solution. This image is of a real-time invert tracker that updates as you move along the pipe.


BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #11 on: July 31, 2012, 01:18:49 AM »
Jeff,

Yet again, you're an excellent resource as I progress with an initiative. I can't wait to try this out tomorrow. I completely overlooked this being possible when I couldn't even use vlax-dump-object on some of the Property Objects. I just went straight to the Object Browser.

I still think I'm going to move forward with the .NET option, as I had already planned on incorporating a pipe-centric 'label station, offset, and elevation' option, in addition to a small litany of LispFunctions that would allow our veteran users to stick with LISP (I'm seemingly one of the only strange birds interested in .NET development at my company).

Again; I can't thank you enough for the continued guidance.
« Last Edit: July 31, 2012, 06:34:48 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #12 on: July 31, 2012, 06:57:33 AM »
Would there be a reason to use InnerDiameterOrWidth in lieu of InnerHeight, given the intent to extract the pipe's invert elevation, if the Point3D (pt) specified is the center of pipe?

Code - C#: [Select]
  1.                             ed.WriteMessage(
  2.                                 "\nINV = {0} ",
  3.                                 (pipe.GetClosestPointTo(pt).Z - (pipe.InnerHeight * 0.5))
  4.                                 );
  5.  

Also, being this is the first time I am in fact working with a 3D pipe element (rather than a 2D Line/Polyline), specifying a Point3D from plan view along the pipe at the midpoint yields an accurate, but unexpected invert elevation... For example if the pipe starts at EL = 10.00, and ends at EL = 0.00 (remember, I'm in Florida! LoL), snapping to the midpoint one would expect EL = 5.00, which is not what is returned.

How would I go about translating the plan view midpoint to the point along the pipe straight down about the Z axis (presuming Top, WCS), rather than the GetClosestPointTo() which is perpendicular to the 3D pipe?  :?
« Last Edit: July 31, 2012, 08:16:24 AM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4093
  • C3D user & customizer
Re: Civil 3D Inquiry Tool & Labels
« Reply #13 on: July 31, 2012, 09:09:34 AM »
Would there be a reason to use InnerDiameterOrWidth in lieu of InnerHeight, given the intent to extract the pipe's invert elevation, if the Point3D (pt) specified is the center of pipe?

How would I go about translating the plan view midpoint to the point along the pipe straight down about the Z axis (presuming Top, WCS), rather than the GetClosestPointTo() which is perpendicular to the 3D pipe?  :?
When I first wrote a number of my pipe utilities the InnerHeight had a bug where it didn't always report the correct height (C3D2007 or 2008) so I just used the other and never checked if the bug was fixed. It appears that it has been.

As for the 2d/3d issue, I cheat. :-) I create a temporary pline using the pipe start/end xy and current drawing Elevation values, find the parameter at the point returned by GetClosestPointTo on the temp pline, then get the point on the pipe at that parameter. There's probably a more elegant way to do this, but it's what I came up with that works reliably.

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Inquiry Tool & Labels
« Reply #14 on: July 31, 2012, 11:15:38 AM »
Would there be a reason to use InnerDiameterOrWidth in lieu of InnerHeight, given the intent to extract the pipe's invert elevation, if the Point3D (pt) specified is the center of pipe?

How would I go about translating the plan view midpoint to the point along the pipe straight down about the Z axis (presuming Top, WCS), rather than the GetClosestPointTo() which is perpendicular to the 3D pipe?  :?


When I first wrote a number of my pipe utilities the InnerHeight had a bug where it didn't always report the correct height (C3D2007 or 2008) so I just used the other and never checked if the bug was fixed. It appears that it has been.

No worries; we use a mix of RCP & ERCP, perhaps more frequently than other states. Wasn't sure how that would affect the calculation. I'll stick with InnerHeight for the time being.

As for the 2d/3d issue, I cheat. :-) I create a temporary pline using the pipe start/end xy and current drawing Elevation values, find the parameter at the point returned by GetClosestPointTo on the temp pline, then get the point on the pipe at that parameter. There's probably a more elegant way to do this, but it's what I came up with that works reliably.

Awesome... I already started coding this; glad to know I was on the right track. I hadn't thought to create a temporary line, as I assumed that I could perform the calculation programmatically instead (untested); but still.

For the line though; do you just handle the deletion in the Catch/Finally block (if it exists)?  :? If so, then I'd need to define the new 'line' outside of my Try scope, correct (otherwise the Catch/Finally block couldn't see it)?

Thanks!
"How we think determines what we do, and what we do determines what we get."