A place to put reminders on how to do things or commands that I will use rarely, but are useful to know.
Ad
Tuesday, March 03, 2009
Civil 3D 2009 VBA Customization
There are also some step by step videos on how to set up a VBA project and example code, some new and some taken from this blog. If your interested in purchasing the book, you can do so at this link.
Sunday, March 01, 2009
Civil 3D 2010 - Intersections
One of the new features in Civil 3D 2010 is "... automated intersection design ...". I've played around with it a bit and have found it to be a good feature. The new feature automates most of the design process of modeling intersections that used to take about a half hour down to 2 to 3 minutes. I find that the byproducts of the intersection design tools are probably the most interesting, but I don't think I can discuss them due to the NDA.
It does take some time to set up the Create Intersection Command (I didn't really do this part), but once complete I was able to model an intersection in as little as 3 clicks. It works great if you work in areas that don't require you to design intersections using such things as the plane method. Since I work mainly in the Southern California market this is a big requirement so if you do also you'll need to go back and update the curb returns. The intersection tool models the curb return profiles by doing a straight grade from the BCR to the ECR, which means if you currently use this method with feature lines the intersection tool will be a significant upgrade since you won't have to go back and change the feature lines if the related centerline profiles are changed. The picture below shows an intersection created using the new tool.
Friday, February 27, 2009
Convert Point Text File to SHP File
There is probably a better way to do this, but I wasn't able to find a better way.
- Import the points into the drawing as Civil 3D Points.
- Set the Point Style to have an AutoCAD point for the marker.
- Explode the Civil 3D Points to be points.
- Go to
- Create a New Table with the fields you want to use with the correct format you want.
For my purposes I'm going to have PointNum as Integer, Desc As Character and Picture As Character.
- Next attach Object Data to the points created.
Make sure that the Correct Table is selected (Easting and Northing are not used).
- Now Export the points to a Shape file using the Map > Tools > Export from the menu, making sure to select the Object Data from the Data Tab.
- If you are using Office 2003 you can use Excel and open the dbf file that accompanies the shape file and overwrite the data with the data from the text file and save the file as a dbf file. Excel 2007 doesn't let you do this so you will have to use Microsoft Access. To use Microsoft Access open the program and then import the DBF file.
Make sure you use the Link to data source to ensure any changes are saved to the dbf file.
- Now delete all of the rows of records by selecting all of the rows and deleting them.
- Next save the text file as an Excel file and put the same headings as the dbf file as the headings, deleting the X, Y values we don't need.
- So now import the Excel data into the Table in Access.
Follow the prompts and make sure how the Excel file is being imported makes sense.
- Now export the Table as a dBASE file to a location you can find.
- Now delete the original .dbf exported and replace it with the Exported dbase file from above. Make sure the you change the name of the file to match the original one, including capitalization of the file name.
- Now import the data to check the data, making sure to assign the Object Data (Map > Tools > Import).
- So when you look in the Properties Palette you will see the imported information.
Saturday, February 21, 2009
Toggle TIN Triangle Visibility
I've been working on surfaces lately, hence the series of Parking Lot Surface posts from last week. I've noticed the need to turn on and off triangles for a surface, either by changing the surface style or changing the style of the surface to show triangles, quite often. It takes about 3 or 4 steps to change it. I thought that was about 2 to 3 clicks too many so I decided to create a VBA routine to cut those steps down.
The first thing to do is create a new VBA file from the VBAMAN dialog box.
Once created press the SaveAs button and save it to a location of your choosing. Next open the Visual Basic Editor and a new module from the Insert Menu and set the references for the Civil 3D Land Modules.
Next add Option Explicit and name the Sub what you want it to be.
Next we need to create some variables and prompt the user to select a surface object.
Now that we have the surface we need to make sure the user selected a surface.
If the user selected a surface we need to set the surface equal to a surface type variable and then check to see if the triangles are showing. If they are the code will turn them off, and if they are showing the code will turn them off.
So now just add some error catching to it, maybe an "On Error Resume Next" at the top of the macro or have the user try again at selecting a surface. So that's how I'm going to be toggling the tin triangles for a Surface Style while doing surface design.
Thursday, February 19, 2009
Parking Lot Surface V
Using the TIN Triangle catches works great until a contour goes through it. As indicated in the picture below we can see that the contour is bending around the curve.
The contour is bending around the curve because the surface was modeled with a straight grade from the BCR and ECR. The surface spot elevation label shows that the temp surface and the parking lot surface are not the same. The difference between the midpoint elevation of the Parking Surface and Temp Surface is not that large, but greatly changes the appearance of the contour. Depending on the length of the curve and the slopes of the parking lot the difference will be either greater or smaller than the one shown. To get rid of the curved contour we will need to add some PVI points to the curve to better approximate the grades of the parking lot. The number of PVI points is dependant on the length of the curve. The picture below shows the affect of adding a PVI at the midpoint.
Both of the quarter points added.
So we can see that the contour doesn't follow the curve and provides a nice straight contour.
Related Posts:
Parking Lot Surface I
Parking Lot Surface II
Parking Lot Surface III
Parking Lot Surface IV
Parking Lot Surface V