Ad

Thursday, August 06, 2009

Pipe Info

In a previous post I created a Custom Pipe oSnap, unfortunately I wasn’t able to figure out a way to show the invert or slope information in the toolbar. After searching the internet for a while trying to find a solution I came across a site that pointed me to an ADN class that covered AutoCAD: TransientGraphics API from May of 08. I downloaded the class information and started modifying the code to work with pipes. The original code took lines, arcs and polylines and divided them up showing points.

Transient graphics allows you to show temporary objects on the screen rather easily. You essentially create objects such as text or points and it draws it on the screen. Using that plus tracking the cursor location you are able to show information on the screen for the user. In this case I wanted to show pipe specific information while I moved the mouse around the screen. Since the code is quite lengthy I’ll let you explore it on your own. I added it to the Civil 3D Reminders Pack and after you netload the dll you can type PipeInfo at the command line and hover over a pipe. Depending on where you are on the pipe will determine if you get an invert or the slope of the pipe. I didn’t spend much time on this to make it look pretty, I don’t have a usability group like Autodesk has, but provides the information. Here’s a quick screencast showing what it does do: http://screencast.com/t/jZxZ9DKFXV4

To end the command type EndPipeInfo. The code is in the QuickEditPipes.vb file. The compiled dll and code may be downloaded at the Civil 3D Reminders Pack webpage.

I’m not sure if I’m going to take this any further at this point. If I add quick edit capabilities I’m not sure how to handle what happens to upstream/downstream pipes. Do you have any ideas?

1 comment:

Civil3d Crash King said...

Chris

Looks good. If the user was to edit a pipe I think you will have to allow the user to branch the code into a couple of different directions.

1. Hold or change the drop if the invert change was minor and it is not effecting any other pipes connected to the structure.
2. Raise or lower preceding or proceeding lines holding the drop and changing incoming/outgoing lines grade.
3. Raise or lower preceding or proceeding lines holding the drop and holding the incoming lines grade. Moving up or down the line raising or lowering pipes to either the end of the line is reached or a user selected structure on the line is reached


Regards

Justin

LinkWithin

Blog Widget by LinkWithin

Ad