Thursday, June 19, 2008
Wednesday, June 18, 2008
Civil 3D 2008 - VBA Report Errors
I'm looking to fix the formatting errors in the vba reports for 2008 and want to make sure I'm not missing any. The errors I have so far are:
1. Angles are not rounded properly for DDMMSS formats for precision's less than 5.
2. Directions are not rounded properly for DDMMSS formats for precision's less than 5.
3. The format for numbers drops the trailing zeros (59.580' is provided as 59.58').
If you know of any others please let me know or where I can find a fixed Reports_Utilities.dvb.
fredbobchris@gmail.com
Labels: Labels, Programming, VBA Links to this post
Wednesday, June 11, 2008
VBA Reports - Direction Fix
When you print out a report that included directions in DDMMSS format and you are using a precision of 4 the report will still print out the .0" value behind the seconds value (S45d34'34.0"E instead of S45d34'34"E). The following only works in 2008 and older. I don't have 2009 installed yet so I don't know if that program still has that problem. To get the .0 removed from the report do the following:
- Run a report that uses a vba report.
- Make a copy of the Report_Utilities file, the file may be found at C:\Program Files\AutoCAD Civil 3D 2008\Data\vba\Report_Utilities.dvb
- Type vbaide at the command line.
- Go to the Report_Utilities and the Format module.
- Change the code in the section that starts with Select Case angFormat
- Change the code to the following
Select Case angFormat
Case aeccFormatDecimal
sAngle = CStr(dAng)
sPostfix = sPostfix + " (d)"
Case aeccFormatDecimalDegreeMinuteSecond
sAngle = sDeg & "." & sMin & sSec & sCnetSec
sPostfix = sPostfix + " (dms)"
Case aeccFormatDegreeMinuteSecond
If angPrec < 5 Then
sAngle = sDeg & Chr(176) & sMin & "'" & sSec & """"
Else
sAngle = sDeg & Chr(176) & sMin & "'" & sSec & "." & sCentSec & """"
End If
Case aeccFormatDegreeMinuteSecondSpaced
If angPrec < 5 Then
sAngle = sDeg & Chr(176) & " " & sMin & "' " & sSec & """"
Else
sAngle = sDeg & Chr(176) & " " & sMin & "' " & sSec & "." & sCentSec & """"
End If
End Select
- Save the file and run the report and see if it works.
Report I was using was Parcel Map Check Report
Labels: Labels, Programming, VBA Links to this post
Friday, June 06, 2008
Fixing the Surface Report
The Surface Report found in the Toolbox is not set to output the values in the correct precision. This means you get all twelve digits wether you want them or not. I wasn't able to figure out how to pull the string values from the XML report directly, but was able to hard code the formatting into the report.
To make the change go into the SurfaceReport.xsl file using notepad or another editor and change the line that contains @area2DSurf to the following:
<td>Area 2D: <xsl:value-of select='format-number(./lx:Definition/@area2DSurf,"##.##")'/>
The "##.##" indicates it is going to round the value to two digits. If you want another precision just add or subtract #'s. Make the same type revisions elsewhere in the document and then save the file and run the report again. Make sure to create a backup copy of the report just in case you want to go back to the original file.
Here's another example:
Original Line of code:
<td>Volume Cut: <xsl:value-of select="@volCut"/>
Revised line of code:
<td>Volume Cut: <xsl:value-of select='format-number(@volCut, "##.##")'/>
Labels: Labels, Programming, Surfaces, VBA Links to this post
From Word to SpecsIntact
This isn't Civil 3D related, just a reminder to my self on how to convert a specification file from Word to SpecsIntact using some macros I created:
Next make sure the SpecsIntact toolbar is showing. If not go right click next to a toolbar and select the SpecsIntact toolbar:
To use the toolbar just select within the text you want to add tags to. For instance if I wanted to add text tags to this paragaraph below:

Labels: Other Links to this post
Wednesday, June 04, 2008
Alignment Style
An alignment style is contained in the Corridor Feature Settings for when you export an alignment from the corridor. So if you can't delete and alignment style because it's used somewhere else and you've checked the Alignment Feature Settings look look in the Corridor Feature Settings.
Labels: Alignment, Corridor, Style Links to this post
Monday, June 02, 2008
Adding Surface Samples to Sections
I may have miss understood the last question. Here's how to sample a surface after you have already sampled sections.
Right click properties for the Sample Line Group
Choose the Sample more sources... button on the Sections Tab in the properties dialog box.
Add the missing surface
Labels: Surfaces Links to this post
Sunday, June 01, 2008
Another Reader's Question
Ghislain writes:
Hi, i have a question for you, if you want. I’m a french canadien and my english is not perfect. I just want to do a cross sections with two surfaces but a create my sample lines and after i want to create multiple section but i see just one of my surface. How can a see my two surfaces and also see my volume difference?<\Blockquote>
First off perfect English is never required to ask a question. Since it sounds like you've already created the section views, I would suggest changing the style of the section you don't want to see to not show. So the section is there, but just not visible.
Labels: Sections, Surfaces Links to this post