Ad

Monday, November 30, 2009

Extract 3DPolyline from Corridor Through an XREF

Have you ever wanted to extract a 3DPolyline from a corridor located in an XREF? Well I’ve added the capability to the Civil 3D Reminders Pack. I took code from the Offset in XREF code from a previous plug in of the month and a previous post on this blog. You can check out the finished product by downloading the Civil 3D Reminders Pack.

Here’s a video of the command in action:

Trip to AU 2009

I started my travels to Autodesk University yesterday. I stopped by some of the notable sights on the way from San Luis Obispo County to Las Vegas.

First up is the James Dean Memorial Intersection where the State Highways 41 & 46 diverge. It’s the place where James Dean had his fatal car accident.

TipToAU2009 005

After going over the hills I made a right turn next to James Dean’s last stop and drove down Petroleum Highway (State Highway 33). Petroleum Highway is named after the many oil rigs along the road.

TipToAU2009 006

In Buttonwillow I came across a large cow along the side of the road. Buttonwillow is the “Heart of Agriculture”.

 TipToAU2009 007

Next stop was the famous Tehachapi Loop. There was a small crowd present to witness one of the 36 daily train trips. The Loop is famous because the train goes over itself as it goes through the loop. Here’s a picture of the tunnel.

TipToAU2009 009

The loop is a National Historic Civil Engineering Landmark. Here’s the history of the loop according to the plaque in place near the loop.

TipToAU2009 010

Here’s a picture of the train going through the loop.

TipToAU2009 024

Next up is a place that I worked at for a time, the U.S. Borax Mine in Boron, CA. For a time in the late 1880’s borax was transported utilizing a 40 mule team. The visitor’s center has a display showing what the team looked like.

TipToAU2009 029

While I was working there they where putting together a new fleet of shovels and trucks (the company I worked for at the time constructed the pad the equipment was assembled on). It was interesting coming into work each day watching the progress on the equipment. There is no real reference in the photo below, but the equipment is really large.

TipToAU2009 031

Here’s a picture of the mine. It’s changed quite a bit since I worked there. The white material is the primary material they are mining, borates.

TipToAU2009 037

Large overburden piles at the mine and a portion of the refining plant.

TipToAU2009 035

On Highway 58 Caltrans appeared to be testing different slope treatments. Behind the fences is a funnel and piping system which appeared to collect the water for testing. Some of the treatments appeared to work better than others. There was also another site near Barstow.

TipToAU2009 038

There was more sights to see such as the Baker Thermometer and the Bakersfield Sign.

Saturday, November 28, 2009

Mass Label Contours - Correction

It looks like I messed up the interval for the Mass Label Contours. To make the correction make the change in the attached screencast. http://screencast.com/t/ZTQ0MDFlYmU

Or you can re-download the file. http://style.civil3dreminders.com/masscontourlabels

Also remember if you are going to AU I’m giving away a SpaceNavigator. Between 6:30pm and 7pm, on Tuesday, I’ll tweet a location to @3DConnexion on where I’m going to be. The first person to find me and ask for the 3DMouse gets the SpaceNavigator.

To follow me on Twitter just sign up and follow me, my Twitter location is: http://twitter.com/C3DReminders While you are there make sure to also follow @3DConnexion.

Wednesday, November 25, 2009

Civil 3D Customization Services

I find myself with some time on my hands and am looking to fill some of it up. Contact me if you are in need of customization services. Services could include:

  • Custom Reports
  • Custom Subassemblies
  • Custom Routines/macros

Find something that you liked on of my previous posts, but want it customized to your own work flow? Send me a line and we can talk about having it improved to meet your needs.

SpaceNavigator Giveaway At AU

Want a free SpaceNavigator? Well I’m giving one away at AU courtesy of 3DConnexion.

Twitter seems all the rage today so I’m going to use Twitter to help give away the mouse. Between 6:30pm and 7pm, on Tuesday, I’ll tweet a location to @3DConnexion on where I’m going to be. The first person to find me and ask for the 3DMouse gets the SpaceNavigator.

To follow me on Twitter just sign up and follow me, my Twitter location is: http://twitter.com/C3DReminders While you are there make sure to also follow @3DConnexion. Most cell phones have downloadable applications that lets you use Twitter, so no need to lug around a laptop. 

Please be safe, no running.

Rotate Headwall

When you move or adjust a location of a headwall it doesn’t remain perpendicular to a pipe like you may want. This post will create a quick VBA macro to rotate the headwall back into place. The code has the user select a structure and then rotates it depending on if it is attached to the start of the pipe or the end of the pipe. The rotation is done in radians, so the rotation is pi.

Option Explicit


' Command to rotate headwall to be 90 degrees from pipe.
Sub RotateHeadwall()
' Always get the objects again since MDI is supported.
If (GetBasePipeObjects = False) Then
MsgBox "Error accessing base civil objects."
Exit Sub
End If

On Error Resume Next

' Select headwall
Dim oStructure As AeccStructure
Dim vPoint As Variant
Dim oAcadObj As AcadObject

ThisDrawing.Utility.GetEntity oAcadObj, vPoint, "Select Headwall to rotate: "

If (TypeOf oAcadObj Is AeccStructure) Then
Set oStructure = oAcadObj
If oStructure.ConnectedPipesCount = 0 Then
' THe structure is not connected to a pipe.
MsgBox "The structure is not connected to a pipe."
End If

Dim oPipe As AeccPipe
Set oPipe = oStructure.ConnectedPipe(0)
Dim dRotation As Double
Dim dStartPt(0 To 2) As Double
Dim dEndPt(0 To 2) As Double
dStartPt(0) = oPipe.StartPoint.X: dStartPt(1) = oPipe.StartPoint.Y
dEndPt(0) = oPipe.EndPoint.X: dEndPt(1) = oPipe.EndPoint.Y

If oPipe.StartStructure.ObjectID = oStructure.ObjectID Then
dRotation = ThisDrawing.Utility.AngleFromXAxis(dStartPt, dEndPt) + (4 * Atn(1)) ' Added 180 degrees to the value
Else
dRotation = ThisDrawing.Utility.AngleFromXAxis(dStartPt, dEndPt)
End If
oStructure.Rotation = dRotation
End If

End Sub



Once compiled you can then add the command to the cui and add it to the right click menu for a structure. Here’s a short video showing the command in action and added to the shortcut menu for a structure object.





It could use some improvement by allowing it to use an already selected object. The code may be found here: http://style.civil3dreminders.com/rotateheadwall



More information on creating a command in the cui may be found in this previous post.

Tuesday, November 24, 2009

Mass Label Contours

Have you ever wanted to label a surface at one time without having to draw multiple lines? Now you can with the simple routine below. The main things that I learned in doing it is the polar point. The polar point allows you to find a point based on a starting point, angle and distance. For this code I find the midpoint between the first and second coordinate point of the contour and then use the polarpoint to find a point a set distance away from the contour that is going to be labeled.

The rest of the code gets some prompts from the user and then extracts the contours from the surface (either major or minor) and the process them, adding the contour labels at interval, starting from the first segment.

The entire dvb file may be found here: http://style.civil3dreminders.com/masscontourlabels

'
' MODULE_ID {Subroutines.bas}
' {LabelContours.dvb}
'
' Copyright {2008} by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software for
' any purpose and without fee is hereby granted, provided that the
' above copyright notice appears in all copies and that both that
' copyright notice and the limited warranty and restricted rights
' notice below appear in all supporting documentation.
'
' AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
' AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
' MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
' DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
' UNINTERRUPTED OR ERROR FREE.
'
' Use, duplication, or disclosure by the U.S. Government is subject to
' restrictions set forth in FAR 52.227-19 (Commercial Computer
' Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
' (Rights in Technical Data and Computer Software), as applicable.
'
'
'
Option Explicit



'
' These are all the subroutines that can be called from
' Civil 3D's VBRUN command.
'


'
' Label major contours
'
'
Sub LabelMultipleContours()
'always get the objects again since MDI is supported
If (GetCivilObjects = False) Then
Exit Sub
End If

Dim oSurface As AeccTinSurface

Dim vPoint As Variant

ThisDrawing.Utility.GetEntity oSurface, vPoint, "Select Surface: "

Dim strInput As String

With ThisDrawing.Utility
.InitializeUserInput 0, "Minor mAjor"
strInput = ThisDrawing.Utility.GetKeyword("Enter contour type to label [Minor/mAjor]: ")
End With

Dim dInterval As Double

On Error Resume Next
With ThisDrawing.Utility
.InitializeUserInput 6
dInterval = ThisDrawing.Utility.GetReal("Interval along contour <500>: ")
' If user enters then utilize the default value.
If Err Then
If Err.Number = -2145320928 Then
Err.Clear
dInterval = 500
Else
ThisDrawing.Utility.Prompt Err.Number
Exit Sub
End If
End If
End With

Dim vContours As Variant

Select Case strInput
Case "Minor"
vContours = oSurface.ExtractContour(aeccDisplayOrientationPlan, aeccSFMinorContours, oSurface.Statistics.MinElevation, oSurface.Statistics.MaxElevation)
Case "mAjor"
vContours = oSurface.ExtractContour(aeccDisplayOrientationPlan, aeccSFMajorContours, oSurface.Statistics.MinElevation, oSurface.Statistics.MaxElevation)
End Select


Dim i As Integer
Dim oPoly As AcadLWPolyline
Dim dX1 As Double
Dim dY1 As Double
Dim dX2 As Double
Dim dY2 As Double
Dim dMidX As Double
Dim dMidY As Double
Dim dM As Double
Dim dMPerp As Double
Dim dBasePoint(0 To 2) As Double
Dim dAngle As Double
Dim dAngle2 As Double
Dim vPolarPt As Variant
Dim vPolarPt2 As Variant

For i = 0 To UBound(vContours)
Set oPoly = vContours(i)
dX1 = oPoly.Coordinates(0)
dY1 = oPoly.Coordinates(1)
dX2 = oPoly.Coordinates(2)
dY2 = oPoly.Coordinates(3)

dMidX = (dX1 + dX2) / 2
dMidY = (dY1 + dY2) / 2
dBasePoint(0) = dMidX: dBasePoint(1) = dMidY

dAngle = ThisDrawing.Utility.AngleFromXAxis(oPoly.Coordinate(0), oPoly.Coordinate(1)) + (4 * Atn(1)) / 2 ' Added 90 degrees to the value

vPolarPt = ThisDrawing.Utility.PolarPoint(dBasePoint, dAngle, 0.01)
vPolarPt2 = ThisDrawing.Utility.PolarPoint(dBasePoint, dAngle, -0.1)

ThisDrawing.SendCommand "_AeccAddContourLabelingGroup " & vPolarPt(0) & "," & vPolarPt(1) & " " & vPolarPt2(0) & "," & vPolarPt2(1) & " " & dInterval & " "
oPoly.Delete
Next

End Sub



adf

Civil 3D in Farming

I recently visited with a farmer who is using Civil 3D to assist  other farmers in mapping their farms for many uses. This post incorporates information provided by him in the form of an email and my visit out to the farm.

First off we need some background on some of the systems the farmer utilizes to maximize crop yield and ensure proper runoff. There are many GIS programs that map and keep track of data such as the amount of fertilizer and where pesticide needs to be or was applied. The GIS programs work well with databases from soil test reports toimage indicate low nutrient or high pest infestation areas which are uploaded to applicator rigs. The applicator rigs are equipped with onboard computers and machine controls called VRA (variable rate application) which increase or decrease fertilizer or pesticide rates according to the soil and field test reports. The VRA also shuts off sections of the spray boom to prevent overlap and double application. The VRA can even be set up to not turn on unless they are in the right field. The VRA utilizes GPS receivers to know where they are in the world.

These programs also track harvesting tonnage and can be used to apply more or less seed the following year. A color map showing the information may be created. They even allow field ticket entry so each harvested load can be tracked for location in case of ecoli outbreak or to find out where plant quality was questionable.

There are many agriculture grading programs that use direct data collection from the tractor via an RTK (real time kenemeticks), utilizing a GPS base station at the farm yard or portable base station. The agricultural systems have best fit plane generation that creates a balanced design plan for dual slope drainage to one corner of the field. You can force your own slopes and it will lift or lower the section until it balances. They even have easy break lines and hinges for smooth transitions. (This would be a cool feature to have in Civil 3D).

After importing the agricultural field information into the tractor’s GPS system you simply set the antenna height in a zero cut/fill area. The machine control, integrated into the tractor’s hydraulic systems, controls the tractor’s scraper bucket to hold the design grade and show you where you are on the onboard monitor. Cut areas are in yellow to red depending on depth of cut, and fill areas are in shades of blue depending on amounts of fill (looks like water retention areas). The driver simply drives into the red area until the bucket is full and drives to the closest blue area until the bucket is empty. The grade is updated until it turns green which indicates it is within 5 hundredths of a foot (.05 foot).

Most newer tractors have auto steering that use the same RTK system to guide them within an inch. They have patterns loaded for following same elevation (farming with the contour). Implement width and offset to calculate where the implement is at at all times to prevent overlap and save extra unneeded passes in the field or to miss underground lines, such as drip tape lines in row crops. The driver does have to turn the tractor around on row crop fields but hits the button and the tractor follows or makes the rows exactly as they were last season.

So how does Civil 3D fit into this process?

The programs functions above are for easy operation with limited functionality. Civil 3D has many functions that are adaptable to extend the functions available in the other programs, even though Civil 3D is relatively complicated program for use in farming.

Farmers are constantly being pushed into other areas and houses take over the old farmland because the farmer did most of the leveling.

Utilizing publically available DEM information basic elevation data from a property may be received and utilized to help farmers determine if another property is worth purchasing or leasing. A color coded map with a legend of how many acres are at different grades for farmable land may be developed to show how the property could be utilized. From this data an appropriate valuation may be derived to either consider an offer to purchase or rent or not pursue the opportunity.

After the customer obtains the land the RTK survey system is used to get the exact lay of the land and map the property as is, with drainage pipes, existing water lines, wells, etc. A map is created in Civil 3D and exported to an older file format for a local irrigation company to design the irrigation system. Parcels are used to delineate the fields to be farmed and show areas not farmable. With the customers input, the best row directions for least erosion and best sun and least wind exposure are found. A surface is created, shown with colors, indicating where the best rows are located.

Civil 3D is also utilized in work with the NRCS (Natural Resource Conservation Service) “The only useful agency left in America besides the police and fire dept” to draw catch basins and drainage canals with their design criteria and best practices manual. I use the excavated yardage calculations from Civil 3D to input into the agriculture grading programs as import to spread over the fields where needed.

Civil 3D may be used to import and export NEZ points from the agriculture programs andFarm Visit-IrrigationPipe data collectors and back to the agricultural programs. As an example the farmer received a DWG farm map previously made and saved as a previous file format for a local irrigation company. They designed an irrigation plan with their older software and emailed it back 1 pm. After opening the file in Civil 3D 2009 he created stakeout points at all the riser and mainline locations of the irrigation company's design plan. He then put them into a group and exported PNEZ in .CSV format to his data collector and staked the mainline and riser locations for the pipe crew to trench and install this week. He then printed size D sheets for the irrigation company to have on the job and labeled it the way they wanted. He had mapped it before but they just finished the irrigation plan and emailed it to him. He labeled the risers and mainline then printed the layout and staked the 30 acre jobsite with 40 stakes and finished by 5:30 pm. That’s even after he had trouble getting the labels to display.

The best thing he liked is the ability to get a call from a farmer who wants to know something over the phone about their property I mapped years ago and being able to tell them what the slope of a field will be and what direction the water will go if they run the rows the same direction as their barn is, or an adjacent road is. He can then tell them what that direction is in degrees and they input the value into the auto steering system and the tractor points itself in that direction. Or when he goes out to a farm he mapped some years ago to find an irrigation line and I mark out where it is and even exactly how deep.

 

Monday, November 23, 2009

SpaceNavigator for Notebooks

I recently got a SpaceNavigator for Notebooks to try out. The device is designed to be small enough to carry around and as the name implies used for notebooks or laptops.

image

The device definitely easily fits imageinside my laptop bag and comes with a carrying case to keep the wire from getting tangling up with all of the other stuff I have in there. In order to keep the device in place it has some weight to it. The device weighs in at 0.55#, this is quite a bit lighter than the SpaceNavigator which weighs 1.06#.

I found the device stayed surprisingly in one place as I used it, although sometimes I got a little too enthusiastic and pulled the 3D mouse up. To correct this I adjusted the overall speed of the device to respond to my expectations on how fast the device should move.

 

The top of the mouse imageis contoured, which I found made it easy to find which direction the mouse should be going. There are also raised lines on the major axes to feel which direction to go. There are two buttons on the mouse that provide some customization. You can assign a command to each button.

Overall I liked the 3D mouse and could see taking the mouse with me on trips where I think I would use it. If I was going to conference where I don’t think I’d bring it along because of the weight of the device.

To get more information on 3D Mouse check out their website or follow them on Twitter.

If your headed to AU look for me on Tuesday where I’ll be giving away a SpaceNavigator mouse, details to follow next week.

 

Disclosure: I received the SpaceNavigator for Notebooks from 3Dconnexion to try out without cost.

Saturday, November 21, 2009

Corridor Section Editor Problem

If you exit out of a drawing while utilizing the Corridor Section Editor command you may find that all of your objects have been hidden, or have disappeared, in model space. In a few steps we can fix the problem.

First type View at the command line. Next change the Clipping value for the current view to Off.

image

Next set the UCS to World then set the view to Top.

image

Your drawing should then be back to normal.

Tuesday, November 17, 2009

Label Bearing/Distance Between Two Points

Have you ever wanted to label the bearing/distance between two points? You can by utilizing a Dynamic Block.

To get this capability I started by utilizing a dynamic block I found in the Dynamic Blocks Discussion Group. I’m not quite sure how to recreate it, but it served its purpose on creating a starting point. I then deleted all of the stuff I didn’t need in the block in the block editor. I then dragged the ends of line to the grip points.

Next I added a bearing and distance label to the line while in block editor. In order to get the line not to show I created a visibility state and then made the visibility state to not show the line or the visibility grip.

Now after inserting the drawing you can move the grips to the points. I then realized the block was at the wrong scale. In order to fix that I found the BMAKE command which allows you to change the units of the block by redefining it.

You can check out the block by downloading this drawing: http://style.civil3dreminders.com/LabelTwoPoints.dwg

Monday, November 16, 2009

Get Modified By and Modified Date for Label Styles

If you wanted to see who modified a label style and when you could go through and select each label style group in Toolspace, Settings and see, but this could take a while. By using the Civil 3D API we can quickly go through and see what the Modified By and Modified Date was for each label style. The code below looks at some alignment and profile label styles. Doing the other types of labels would be similar.

Sub CheckStyles()

'always get the objects again since MDI is supported
If (GetBaseCivilObjects = False) Then
Exit Sub
End If

Dim oStyle As AeccLabelStyle

For Each oStyle In g_oRoadwayDocument.AlignmentLabelStyles.CurveLabelStyles
MsgBox "Alignment Curve Label Style: " & oStyle.Name & vbCrLf & _
"Modified By: " & oStyle.ModifiedBy & vbCrLf & _
"Date Modified: " & oStyle.DateModified
Next

For Each oStyle In g_oRoadwayDocument.AlignmentLabelStyles.MajorStationLabelStyles
MsgBox "Alignment Major Station Label Style: " & oStyle.Name & vbCrLf & _
"Modified By: " & oStyle.ModifiedBy & vbCrLf & _
"Date Modified: " & oStyle.DateModified
Next

For Each oStyle In g_oRoadwayDocument.ProfileLabelStyles
MsgBox "Profile Label Style: " & oStyle.Name & vbCrLf & _
"Modified By: " & oStyle.ModifiedBy & vbCrLf & _
"Date Modified: " & oStyle.DateModified
Next


End Sub



This code just goes through and shows you the information, you could also have If … Then statements to further reduce the label styles that will be shown. You could also add some code that would batch process numerous drawings at one time. Instead of a MsgBox the results could be sent to an Excel spreadsheet or a text document.

Sunday, November 15, 2009

Rebuild All Surfaces

This post will go over rebuilding all surfaces in a drawing, well sort of. It will rebuild all surfaces in a drawing, but since there is no way of telling, through the API, if a surface is out of date it will possibly leave some surfaces out of date after it runs. The code is below, add it to the corridor post code from yesterday and it should run.

' Added update surfaces routine.
Sub UpdateAllSurfaces()
'always get the objects again since MDI is supported
If (GetBaseCivilObjects = False) Then
Exit Sub
End If

Dim oSurface As AeccSurface
For Each oSurface In g_oRoadwayDocument.Surfaces
oSurface.Rebuild
Next

End Sub

Saturday, November 14, 2009

Rebuilding Corridors

Steven Didak posted a command to rebuild all corridors or rebuild all out of data corridors on his blog. He’s also got a great home office set up. His version was created for Civil 3D 2010 and is available as a dll file.

If you don’t have Civil 3D 2010 you can get the same functionality with the code below. Just change “AeccXUiRoadway.AeccRoadwayApplication.7.0” to match your version:

Civil 3D 2008: “AeccXUiRoadway.AeccRoadwayApplication.5.0”

Civil 3D 2009: “AeccXUiRoadway.AeccRoadwayApplication.6.0”

Civil 3D 2011: “AeccXUiRoadway.AeccRoadwayApplication.8.0” (Presumably this will be the value)

I started the code with the CorridorSample that ships with the product. The finished product may be downloaded here: http://style.civil3dreminders.com/UpdateCorridors.dvb

You’ll also need to update the references: http://blog.civil3dreminders.com/2008/09/updating-references.html

If you have dependent corridors, the code may have you end up with out of date corridor. Since updating in the wrong order could cause the other corridor to become out of date after it has been updated.

'
' MODULE_ID {Subroutines.bas}
' {CorridorSample.dvb}
'
' Copyright {2009} by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software for
' any purpose and without fee is hereby granted, provided that the
' above copyright notice appears in all copies and that both that
' copyright notice and the limited warranty and restricted rights
' notice below appear in all supporting documentation.
'
' AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
' AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
' MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
' DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
' UNINTERRUPTED OR ERROR FREE.
'
' Use, duplication, or disclosure by the U.S. Government is subject to
' restrictions set forth in FAR 52.227-19 (Commercial Computer
' Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
' (Rights in Technical Data and Computer Software), as applicable.
'
'
'
Option Explicit
'

' This sample demonstrates how to access various types
' of information about corridors that exist in the
' current document. It is hard-coded for use with the
' "Corridor-4b.dwg" file located in the Civil
' "Help\Civil 3D Tutorials\Drawings\" directory. The
' sample will work for other corridors, except that
' the volume surface test will not create a volume
' surface.


'
' Main entry point from the VBARUN dialog box.
'

Public g_oCivilApp As AeccRoadwayApplication
Public g_oRoadwayDocument As AeccRoadwayDocument
Public g_oRoadwayDatabase As AeccRoadwayDatabase


'
' Start Civil 3D and create Civil 3D document and database objects
' for use with corridor objects.
'
Function GetBaseCivilObjects() As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
' NOTE - Always specify the version number.
Const sAppName = "AeccXUiRoadway.AeccRoadwayApplication.7.0"
Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating " & sAppName & ", exit."
GetBaseCivilObjects = False
Exit Function
End If
Set g_oRoadwayDocument = g_oCivilApp.ActiveDocument
Set g_oRoadwayDatabase = g_oRoadwayDocument.Database
GetBaseCivilObjects = True
End Function

' Added update corridor routine.
Sub UpdateAllCorridors()
'always get the objects again since MDI is supported
If (GetBaseCivilObjects = False) Then
Exit Sub
End If

Dim oCorridor As AeccCorridor
For Each oCorridor In g_oRoadwayDocument.Corridors
oCorridor.Rebuild
Next

End Sub

Sub UpdateOODCorridors()
'always get the objects again since MDI is supported
If (GetBaseCivilObjects = False) Then
Exit Sub
End If

Dim oCorridor As AeccCorridor
For Each oCorridor In g_oRoadwayDocument.Corridors
If oCorridor.OutOfDate = True Then
oCorridor.Rebuild
End If
Next

End Sub

Tuesday, November 10, 2009

Average Surface Slope

Sometimes different terminology is used that we aren’t used to. One example I’ve come across is finding the Average grade/slope of a surface. If we look in the Surface Properties we don’t see a listing for the Average grade/slope of a surface.

image

But if you take a look at the highlighted row we see we are provided with the Mean grade/slope. Mean is synonymous with Average. If you sit down and do the math you find that it’s the weighted average slope of the surface. For the surface above the unweighted average is 2.713%.

Select Unselectable Word Pictures

I can across a picture I couldn’t select in Word. It took me a while to find, but to select it use the Select option under the Editing portion of the Home Ribbon Tab. Hovering over it even tells you what it’s good for.

image

I used the Select Objects option to just select the picture to move it to the correct location.

Monday, November 09, 2009

Putting Alignment on Correct Layer

Sometimes things happen and your alignments are not on the correct layer. There really isn’t an easy way within the program to change the layer. We can create some customization that will make the task easier. This post will outline one way to automate the process.

To start out with I’m utilizing the sample alignment code that ships with the product (C:\Program Files (x86)\AutoCAD Civil 3D 2010\Sample\Civil 3D API\COM\Vba\Alignment\). I’ve gone ahead and deleted most of the code I don’t need.

Next I added the code required. First I check to make sure that Civil 3D is running. Next I create the variables need to get the alignment and then create the layer I wanted. Next I got the Object Layer the alignment should be on. For this code I’m assuming that the layer has the –* modifier for the alignment layer.

Next I’ve gone through every object in Model Space and checked to see if it’s an alignment. If it is then I set what the alignment layer name should be and then I check to see if the alignment is already on the correct layer. If the layer isn’t created I then create the layer. If the layer doesn’t exist in the drawing, and we don’t add it, then an error message will result. Then I assign the alignment to the newly created layer.

Sub PutAlignmentOnLayer()
'always get the objects again since MDI is supported
If (GetBaseCivilObjects = False) Then
Exit Sub
End If

Dim oAcadObject As AcadObject
Dim oAlignment As AeccAlignment
Dim sLayer As String
Dim sNewLayer As String

sLayer = g_oDocument.Settings.DrawingSettings.ObjectLayerSettings.AlignmentLayer.Layer


For Each oAcadObject In ThisDrawing.ModelSpace
If (TypeOf oAcadObject Is AeccAlignment) Then
Set oAlignment = oAcadObject
sNewLayer = sLayer & "-" & oAlignment.Name

' Check to see if the alignment is already on the correct layer
If sNewLayer = oAlignment.Layer Then
' The alignment is already on the correct layer.
Else
' Assign the correct layer
ThisDrawing.Layers.Add sNewLayer
oAlignment.Layer = sNewLayer
End If

End If
Next

g_oCivilApp.Update
End Sub



The code could be optimized by only examining the alignments in the sites and siteless, but I’m just doing this as an example. The same thought process could be used for surfaces, profiles or other Civil 3D objects. You can download the code here: http://style.civil3dreminders.com/AlignmentChangeLayer.dvb

Friday, November 06, 2009

#AU2009

au09_badgeI’m kind of going to AU. I’ve done a poor job monetizing the blog, so I don’t have the cash to pay for admittance. I am going to try to get into the DevLab and see if I can get some help on some things I’ve been working on as well as heading over to the blogger’s social. I’ve even signed up to be a Lab Assistant for a class.

I’ll also have a 3D Mouse to give away at AU thanks to 3DConnexion, so look for details later this month on how I’m going to give them away. You can follow 3DConnexion on Twitter.

While your on Twitter make sure to follow @mrcadman he’s looking to raise $2000 to the Susan G. Komen Breast Cancer Foundation (http://ww5.komen.org/) and looking to get over 2000 followers to his Twitter account. If meets both goals he’ll be shaving his head at AU for the cause. He’ll also have some fun spur of the moment using Twitter during AU.

Tuesday, November 03, 2009

AUTOCAD CIVIL 3D TRAINING NOTES TURKISH FIRST DISCOVERY BOOK!

Not quite sure if Google Translate got the translation correct, but if speak Turkish you can now get a Civil 3D book. The information is below:

İLK TÜRKÇE AUTOCAD CIVIL 3D EĞİTİM NOTLARI KİTABI ÇIKTI!!!
400 SAYFA VE KUÅžE KAÄžIDA
FÄ°YATI 40 TL
Kitaplar PROTA Ankara ve PROTA Ä°stanbul ofislerinden temin edilebilir .
Kargo ücreti alıcıya ait olmak üzere adresinize de ulaştırılabilir.
Ä°stanbul Ofisi:
İrtibat : Semra Avcı
Yıldız Mah. Çitlenbik Sok.
Temizkanlı Apt. 34345 No: 22/3
BeÅŸiktaÅŸ Ä°STANBUL

kitap

http://www.prota.com.tr

LinkWithin

Blog Widget by LinkWithin

Ad