Ad

Sunday, August 31, 2008

Isolating Objects

Ever since the base AutoCAD program changed the way layers are isolated, I have found I have been using the Isolating Objects command that comes with Civil 3D more often. This command is great since you can isolate objects just by selecting them.

To use the command select an object and go the right click menu. Choose the right-click, and click Isolate Objects Hide Selected Objects.

image

Now just the objects you selected are shown. You can also get to the command from the Tray at the bottom of the screen with the light bulb icon.

image

Yellow indicates no objects are being isolated and red indicates objects are being isolated.

To end the isolation just use the End Isolation option by right clicking on the light bulb and the objects will reappear.

Friday, August 29, 2008

HEC-RAS Report 2

Well in the last post I covered how to fix an error, but lets say you want to show more or less significant digits. To do this type VBALOAD and find the vba file for the HEC-RAS Tools. Do a search for Round in the entire project. You should find some lines of code that look similar to this:


ReachCoords(q) = Round(oStation.Easting, 2)


The Round() function takes a number, in this case the easting of an alignment PI point, and rounds it to the corresponding digits. For this line of code the number format would be 5.12, which is probably good enough. But lets say the boss wants to see it to four digits, well just change the 2 to a 4 and the output will now be four digits.


There is a problem using the Round() function in VBA. The problem is that it uses banker's rounding so instead of rounding in the normal manner you were probably taught in school, the number is rounded to the nearest even number if a 5 is the digit for rounding. So 1.235 and 1.245 will both give the result of 1.24 instead of 1.24 and 1.25 respectively.


To get normal rounding you can use the Format$() function that will round normally. It just converts the number to a string, but in this case it should be acceptable. The code could be revised to be:


ReachCoords(q) = VBA.Format$(oStation.Easting, "#.00"))

You could also look at the vba code reports and change the report to look at the drawing settings to get the rounding value or put the number of digits to round to in the form used to run the report so you can change it when you run the report.

Thursday, August 28, 2008

HEC-RAS Report

If you haven't heard, Autodesk released a revised HEC-RAS tool to import and export data between Civil 3D and HEC-RAS. It is available to download from the subscription site.
It appears that some of the code doesn't work correctly if you have free curve in the alignment and then reverse the alignment. The error message that is recieved is the one below (run-time error Invalid input.).

I'm not sure if the error is in the report or in Civil 3D. It appears that the entity count of the alignment returns a larger value than what is in the alignment. In my case I had three entities, but it returned that I had six. So when it ran looking for six, Civil 3D indicates that it isn't there and you get the error message. To fix it press the debug button and replace the code in the Public Function GetStreamCoords to End Function with the code below. This code uses a different method to get the PVI stations, the one from the original HEC-RAS report that shipped with the program. You may want to make a backup copy of the report in case it doesn't work.

' Get the stream alignment coordinates

' Fills up the stream network end points section

Public Function GetStreamCoords(ByRef ReachCoords() As Double, calign As AeccAlignment, csurf As AeccSurface)

Dim PLSta As Double

Dim PLOffset As Double

'Station & Offset of Pline Beg. Pt.

Set ReachEnts = calign.Entities

ReDim ReachCoords(0 To (ReachEnts.count * 4 + 3))

Dim oStation As AeccAlignmentStation

Dim q As Integer

q = 0

For Each oStation In calign.GetStations(aeccGeometryPoint, 0#, 0#)

ReachCoords(q) = Round(oStation.Easting, 2)

ReachCoords(q + 1) = Round(oStation.Northing, 2)

ReachCoords(q + 2) = Round(csurf.FindElevationAtXY(ReachCoords(q), ReachCoords(q + 1)), 2)

ReachCoords(q + 3) = Round(oStation.Station, 2)

q = q + 4

Next

End Function

Tuesday, August 26, 2008

Autodesk University 2008

Well it looks like my main reason for not going to AU 2008 (AU2009 moving to June) may or may not be a possibility. I guess Las Vegas is popular in June and commands more money. So I'll let you the readers decide if I should ask the bosses if I may go. Just vote in the poll to the right of the page. I'll do what ever the poll results come out as, I just can't promise that the bosses will let me go.

Toolbox (2008) VBA Reports - Nothing Happens

If you ever have one of the dvb type reports not be able to run and doesn't post an error message to the Event Viewer you may need to run a repair on Civil 3D 2008 to get the reports to work correctly.

From what I can tell the dvb program is erroring out after it checks to make sure Civil 3D is running and that is triggering an error message. The next error catcher in the program exits the macro without sending an error message to the Event Viewer, which makes it appear that nothing happened.

LinkWithin

Blog Widget by LinkWithin

Ad