Author Topic: Pipes Rules and Terrain  (Read 5296 times)

0 Members and 1 Guest are viewing this topic.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Pipes Rules and Terrain
« on: June 04, 2007, 10:30:03 AM »
Last Friday.....

« Last Edit: June 04, 2007, 10:38:47 AM by mjfarrell »
Be your Best


Michael Farrell
http://primeservicesglobal.com/

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #1 on: June 04, 2007, 12:27:20 PM »
Just last Friday...Someone was asking exactly how to use the VBA Sample included with Civil 3D for importing, and exporting Pipe Runes to Excel?  And to be honest I just don't know exactly how it's supposed to work.  Anyone have any experience they would like to share?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Cannon

  • Guest
Re: Pipes Rules and Terrain
« Reply #2 on: June 04, 2007, 12:51:18 PM »
It just dumps info into an excel table. If you're careful, you can edit that table, and send it back. Depending on how good you are with VBA, you can modify this to tie to your design spreadsheets, etc.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #3 on: June 04, 2007, 04:23:12 PM »
James,

I get a missing Reference Project error when I try to use any of the Macros?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Cannon

  • Guest
Re: Pipes Rules and Terrain
« Reply #4 on: June 04, 2007, 08:06:13 PM »
I haven't fired them up this year. You'll have to check to see if a reference has changed. Maybe it's still pointing at an 07 file?

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #5 on: June 05, 2007, 12:11:24 AM »
uh, how could it do that, when 07 was never installed on this machine?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Cannon

  • Guest
Re: Pipes Rules and Terrain
« Reply #6 on: June 05, 2007, 09:04:56 AM »
That could be the sticker. It's entirely possible the sample code was never updated. I'll try and open it up this afternoon.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #7 on: June 05, 2007, 10:05:06 AM »
In the Meantime.....I humbly submit the following procdure for place pipes along a surface profile:

Civil 3D process for Matching Pipe Run Profile to Any Surface

Create Pipe Run Alignments using Featurelines

Use the Grading>>Edit Feature Lines>>Elevations From Surface

To set feature line elevations from a surface

Click Grading menu Edit Feature LinesElevations From Surface.
In the Set Elevations From Surface dialog box, select a surface.
Select the Insert Intermediate Grade Break Points check box to insert intermediate grade breaks where the entity crosses surface TIN lines. Elevation points are created at these locations.
Click OK.
Do one of the following:
Select the feature line or other object.
Enter Multiple. Then select multiple objects.
Enter Partial. Then define a portion of the feature line to assign elevations to.
The feature line is given the elevations of the underlying surface. To edit these elevations, see Editing the Elevations of a Feature Line.

See the Help File Entry for the following for working with Feature Line Elevations.:

AutoCAD Civil 3D 2008 User's Guide > Dialog Box Reference > Grading Dialog Boxes >
Elevation Editor
Raise or lower the Feature line elevations as required. Such as at major grade break points, or to match design station and invert elevation.  Note the option to insert the intermediate Grade Break points used above may then warrant the use of the Weed vertices's function of Feature Line Editing.

 

To weed vertices's

Click Grading menu Edit Feature Lines Weed.
Do one of the following:
Select the feature line or other object.
Enter Multiple and then select multiple objects to weed.
Enter Partial and then select the object and the portion of the object to weed.
The vertices's of the object(s) you selected are highlighted with green triangles and the Weed Vertices's dialog box is displayed.

Select the check boxes for the weeding factors that you want to apply and specify the values to use.
When you specify a value that will delete a vertex, that vertex is highlighted in red in the drawing, and a message is displayed in the dialog box indicating how many vertices's will be deleted. After you change a value, press Tab to update the message and the drawing display.


Points selected for weeding are highlighted in red




See Help File Reference for:


AutoCAD Civil 3D 2008 User's Guide > Dialog Box Reference > Grading Dialog Boxes >
Weed Vertices's Dialog
Then use the Create Pipe Network From Object.  Your Pipe Rules can be set how ever they are mostly ignored during this process, This suggest your rules begin with:

Min Depth (As Required)   Max Depth (As Required)

Min Slope 0%      Max Slope (Design Max)

 

To create a pipe network from an object

Click Pipes menu Create Pipe Network From Object.
In the drawing, select the object.
NoteYou can enter Xref to select an object from an Xref.
You may be prompted to reverse flow direction. Press Enter or click OK to keep the current flow direction. Click Reverse to change the current flow direction. Flow direction arrows indicate the direction of the flow.

In the Create Pipe Network From Object dialog box, specify a name for the pipe network.
In the Description field, enter an optional description for the pipe network.
In the Network Parts List field, select a parts list or accept the default parts list for this pipe network. For more information, see Part Catalog and Parts Lists.
Your Parts List MUST contain a Structure; even though you may want to use Nulls at all pipe connections
In both the Pipes To Create and Structures To Create fields, select the types of pipes and structures to be used.
NoteYou must select both a pipe and a structure type. After creating the pipe network, if desired, you can delete parts you want removed.
To view or change the default layers that will be assigned to various pipe network parts, click Layers to open the Pipe Network Layers dialog box.
To reference a surface and/or an alignment, select the item in the list, or click  to select a surface and/or alignment in the drawing.
If you want the originally selected object to be removed from the drawing automatically, clear the Erase Existing Entity check box.
Select the Use Vertex Elevations check box if you want to use the elevations of any vertexes along the selected entity to set the elevations of the pipes created in the network.
NoteFor 3D entity types, this option determines of the 3D vertex elevations are honored by the pipes created. When checking this option, rules are not applied as they would likely be in conflict with the vertex elevations.Click OK in the Create Pipe Network From Object dialog box.
The new pipe network is displayed in the drawing, and the pipe network name is displayed in the Pipe Networks collection on the Prospector tab.

 

Delete all unwanted structures from the network prior to drawing the Pipe Network Parts in the Profile Views.

 

« Last Edit: June 05, 2007, 10:06:40 AM by mjfarrell »
Be your Best


Michael Farrell
http://primeservicesglobal.com/

sinc

  • Guest
Re: Pipes Rules and Terrain
« Reply #8 on: July 05, 2007, 10:29:06 PM »
I tried messing around with these, and I couldn't get any of the VBA sample projects to work.  However, I haven't messed with VBA too much, and I could have been overlooking something simple.  It looks like all the references are attached, but nothing is working.

Of course, it looks like at least most of those expect MS Office to be running, and I don't have MS Office on this machine.  However, the errors I'm seeing seem to indicate that none of the Autodesk stuff can be seen, either...

Hmm.  Strange.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: Pipes Rules and Terrain
« Reply #9 on: July 06, 2007, 11:59:05 AM »
I was able to run the PerformFullPipeDemonstration & ExportToExcel after making the following changes:
1:  VBAIDE, Tools menu, References: Here you should find 2 missing references (it will say MISSING after the reference) near the top of the list. Note which they are and uncheck them. Now scroll down and find the ones that are for your version of Word & Excel and check those.

2:  There are some mis-placed "On Error GoTo 0" lines in the PartList code. Modifying the beginning portion of the code between the commented lines gets it to work:
Code: [Select]
    'Start Word and open the document template.
    On Error Resume Next
    Set oWordApp = GetObject(, "Word.Application")
    If Err.Number <> 0 Then
        Err.Clear
        On Error Resume Next
        Set oWordApp = CreateObject("Word.Application")
        If Err.Number <> 0 Then
            MsgBox "Could not start Microsoft Word."
            Err.Clear
            ExportPartsListToWord = False
            Exit Function
        End If
    End If
    On Error GoTo 0
    oWordApp.Visible = True
    On Error Resume Next
    Set oWordDoc = oWordApp.Documents.Add
    If oWordDoc Is Nothing Then
        MsgBox "Could not create a new Word document."
        ExportPartsListToWord = False
        Exit Function
    End If
   
    On Error GoTo 0

    ' Get the settings from the Pipes document object, casting
    ' it to type AeccPipeSettingsRoot.
    Set oSettings = g_oPipeDocument.Settings
Note that the FullDemonstration creates a 57 page Word document which takes a bit of time, so don't give up on it.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #10 on: July 06, 2007, 01:44:01 PM »
Jeff,
thanks for the input.  The issue I am now facing is as follows.
When I have Word/Excel open and I export the Pipe Run to Excel all works as expected.
However, when I attempt to then Import that same run (workbook) back into civil 3d, I get errors.
If I remove column titles and instances of "Handles" in the workbook I then get various Run Time Errors.
Any thoughts on that?  Or might the code changes you are suggesting correct that issue? Although both of the Full Pipes and Export to Excel seem to function correctly without any edits?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: Pipes Rules and Terrain
« Reply #11 on: July 06, 2007, 02:00:51 PM »
Hi Michael,
It's possible they are working without edits since you already have Word & Excel open. I didn't and that's why I found the error.

I don't think those changes will affect the errors in the import. I am getting an error when I change the pipe slope and the code tried to connect the end back to the structure. Not sure what to make of that...I'll play with it some more at lunch to see what I can find.

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: Pipes Rules and Terrain
« Reply #12 on: July 06, 2007, 04:24:33 PM »
Ok, I think that this has to do with what James said: "If you're careful, you can edit that table, and send it back." Since I'm not really sure what I can & can't edit in the spreadsheet I don't think I can help much until I can look at it more carefully.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #13 on: July 06, 2007, 04:57:03 PM »
I hear what you are saying, perhaps James should be more forthcoming with his help.
Although, one would think that one should be able to Import the SAME file that was created by that application with NO edits and NOT get any errors.
The challenge is that it wont import the file it wrote without an error; so I tried to remove what appeared to be the offending data.  This did allow the app to progress a bit further, however the end result was yet another error.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Jeff_M

  • King Gator
  • Posts: 4098
  • C3D user & customizer
Re: Pipes Rules and Terrain
« Reply #14 on: July 06, 2007, 06:33:41 PM »
OK, I found where it errors with the sample data. When the pipe is not attached to a structure the code fails here:
Code: [Select]
                oPipe.Disconnect aeccPipeStart
                oPipe.ConnectToStructure aeccPipeStart, oStructure
                Set oStructure = oPipe.EndStructure
                oPipe.Disconnect aeccPipeEnd
                oPipe.ConnectToStructure aeccPipeEnd, oStructure
Revising it to this:
Code: [Select]
                If Not oStructure Is Nothing Then
                    oPipe.Disconnect aeccPipeStart
                    oPipe.ConnectToStructure aeccPipeStart, oStructure
                End If
                Set oStructure = oPipe.EndStructure
                If Not oStructure Is Nothing Then
                    oPipe.Disconnect aeccPipeEnd
                    oPipe.ConnectToStructure aeccPipeEnd, oStructure
                End If
allows it to run. I was also able to change the values in Yellow in the spreadsheet and they get reflected in the drawing.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Pipes Rules and Terrain
« Reply #15 on: July 13, 2007, 01:42:43 PM »
OK, here is the final on this; at least for now.

The included VBA application will NOT draw the pipes, if said pipes do not already exist in the drawing.
It also will not allow the user to alter any data in the export XLS file other than in the YELLOW columns, it simply ignores those edits and in some cases it will generate runtime errors.

However, IF the user creates the pipe runs as 'place holders' in the C3D drawing, then exports to Excel, and uses ODBC to Link ones design application database, or design formatted Excel workbook; then it does prove usefull. The user can then use the design application values to populate the exported workbook values and draft the pipes WITHOUT needing to deal with the fact that C3D will not adjust the invert of all pipes in the run through a single edit, as is possible in Pipes module of Civil Design within Land Desktop.

I am hopeful however that a couple of intrepid souls might be able to get this thing to draw pipes directly from the data in the design application or spreadsheet without the need to create the pipes within C3D first.

I want to thank those that have been of assistance. Thank You! Thank You! to SINC, and Jeff_M
Be your Best


Michael Farrell
http://primeservicesglobal.com/