Ad

Wednesday, July 30, 2008

Question: VBA Structure Table

Lynn asked:

"Is there any way to create a structure table in civil 3d 2007? I also am very interested in anything you come up with on mitered end sections."

Well I've been busy with other things and haven't gotten to the MES, maybe once the kitchen is done. For the structure table it should be rather quick so I'll go ahead and do a post on this. I'm going to skip most of the beginning steps. One can find the beginning steps from my AU presentation last year. Just like the AU paper I'm using the sample code that comes with Civil 3D:

C:\Program Files\AutoCAD Civil 3D 2009\Sample\Civil 3D API\Vba\Pipe\PipeSample.dvb

Lynn indicated that the table should look like this:

structure_table

We need the Structure Name, Pipe Description, Top Elevation/Throat Elevation and Invert Elevation. Using the sample code the code for each one of the items would be:

Structure Name

sheetStructures.Cells(iRowStructures, 1).Value = oStructure.Name

Structure Description

sheetStructures.Cells(iRowStructures, 1).Value = oStructure.Description

Top Elevation

sValue = "TOP EL= " & Math.Round(oStructure.RimElevation, 2)
sheetStructures.Cells(iRowStructures, 1).Value = sValue
iRowStructures = iRowStructures + 1

Invert Elevation

sValue = "INV EL= " & Math.Round(oStructure.RimElevation - oStructure.PipeLowestBottomDepth + oStructure.PipeWallThickness(1), 2)
sheetStructures.Cells(iRowStructures, 1).Value = sValue
iRowStructures = iRowStructures + 2

So then we need to put it all together and we get what a report we can run and the structure information will be exported to Excel where we can Paste Special the data into a table in Civil 3D. The code for the invert elevation won't give the correct result if the wall thickness of the pipes entering the structure are not the same. It probably not exactly what you need, but it should get you closer than typing in all the values by hand. I posted the file here (the version is currently 2009, I will change the references tomorrow when I have access to 2007).

Tuesday, July 29, 2008

Carbon Neutral

Anybody have links to carbon neutral site materials? I'm looking for pavements, walls, benches etc... I don't think it's possible without the supplying companies buying carbon credits to offset the carbon created, but you never know.

Thanks.

Sunday, July 27, 2008

Tips and Tricks

After attending the Central Coast Civil 3D User group, I came up with some Tips and Tricks the presenters didn't use that could have been helpful. Here they are:

  • Use the command CloseAll, don't have to spend a whole lot of time having people watch you close your drawings.
  • If you need to switch between drawings, Alt+Tab works pretty well, quicker then going to Windows on the menu bar. Or if you want to use the Taskbar check this post: http://blog.civil3dreminders.com/2007/06/taskbar.html
  • Ctrl-A works in Elevation editor, so you don't have to select the first line and select the last while holding the shift key. (I remember seeing it on another blog before, just couldn't find it otherwise I would have posted a link).
  • When you offset a feature line you can offset it in both directions. Helps make it so you don't forget to do other side.

Subassemblies: Greater Than Zero

In Civil 3D 2009 some of the subassemblies you get an error when you input a zero depth. After the first few times this may get old. There is a way to get rid of it though, it takes some programming though. I haven't actually tested the code, but it should work.

The first thing you are going to need is to download a program that edits a vb.net program. Microsoft provides Microsoft Visual Basic Express Edition for free. Next open the Visual Basic Project that ships with the program. It resides at the following location (for Vista, XP will vary):

C:\Program Files (x86)\AutoCAD Civil 3D 2009\Sample\Civil 3D API\C3DStockSubAssemblies\C3DStockSubassemblies.sln

If you are using the 2008 Express Version you will be asked to update the code, go ahead and do it. Choose the Subassembly you want to change and scroll down to the part that checks the user input:

        '------------------------------------------------------------------------
'Check user input

If vBaseDepth <= 0 Then
Utilities.RecordError(corridorState, CorridorError.ValueShouldNotBeLessThanZero, "BaseDepth", "LaneOutsideSuper")
vBaseDepth = BaseDepthDefault
End If

This is the line of code that sends the error message to the Event Viewer when you enter a value less than zero. Since you probably want an error message to still exist for values less than zero change the code to read something like this:


        If vBaseDepth <= 0 Then
If vBaseDepth = 0 Then
vBaseDepth = 0.001
Else
Utilities.RecordError(corridorState, CorridorError.ValueShouldNotBeLessThanZero, "BaseDepth", "LaneOutsideSuper")
vBaseDepth = BaseDepthDefault
End If
End If

You will need to make the changes to the other user inputs and this should get rid of the error messages and make the depths an acceptably small number for Civil 3D. Build the code and replace the existing dll at C:\ProgramData\Autodesk\C3D 2009\enu\C3DStockSubassemblies.dll

Friday, July 25, 2008

Official Blog Address Change

Thanks to all you readers out there who enabled me to get some revenue from Google. It took two years, but it finally happened (I think that comes out to less than a $0.01/hour rate, less than the compensation for being an AU speaker). So I went out and got my own domain using part of the proceeds. The new web address for the blog will be:
http://blog.civil3dreminders.com/.

In the next few weeks the http://fredbobchris.googlepages.com/intermittentblockoftheday site will be moved over and reorganized to make it easier to find things for the people who actually download stuff from there.

Next week I'll be posting another Pipe Part family so stay tuned.

LinkWithin

Blog Widget by LinkWithin

Ad