A place to put reminders on how to do things or commands that I will use rarely, but are useful to know.
Ad
Thursday, June 19, 2008
VBA Parcel Map Check Rounding Error
Wednesday, June 18, 2008
Civil 3D 2008 - VBA Report Errors
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
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
Friday, June 06, 2008
Fixing the Surface 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, "##.##")'/>
From Word to SpecsIntact
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:
Once you have gone through and added all of the tags copy the entire document and add it to a blank SpecsIntact file. You may want to create a new SpecsIntact file and paste within the document type tags.