Ad

Thursday, June 19, 2008

VBA Parcel Map Check Rounding Error

The vba Map Check Report rounds the raw value of radians before it passes it to the Reports_Utilities.dvb file which causes it to give incorrect values if the direction precision is set to 4. To correct this I changed the code in the Data Extractor Module of the Report_ParcelMapCheck.dvb to not round the value. Instead it just sets the direction to whole value. It doesn't need to round it here since it rounds it later on when it prints it to html.


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

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.

image

  • Change the code in the section that starts with Select Case angFormat

image

  • 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

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, "##.##")'/>

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:

First load the toolbar from the SpecsIntact.dot (a Microsoft Windows template file). To do this go to the menu bar and choose Tools>Templates and Add-ins.

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:

I would place place the cursor with in the text you want the text tags added to and press the Text toolbar item to place the tags. The program will had the correct tag to the beginning and end of the paragraph.
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.

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.

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

image

Choose the Sample more sources... button on the Sections Tab in the properties dialog box.

image

Add the missing surface

image

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.

LinkWithin

Blog Widget by LinkWithin

Ad