In a previous post I went over the steps to create COGO Points from a TIN surface without having to go in and turn on points and then extracting the points from the surface. I used the generic AeccSurface object to do this, which should have worked for other types of surfaces as well. There is a problem in the code when used with DEM surfaces. DEM surfaces tend to have a large amount of points and I was using an integer value when storing the number of points that needed to be added to the drawing. Well an integer value only goes up to 32767 in VBA, which as mentioned previously is easily exceeded with a DEM file. To fix the code the variable type needs to be changed that allows a larger number. In this case I’m going to go with a Double value which goes up to 1.79769313486232 E 308. So just change the Integer to Double and the code should work with DEM files.
Sunday, May 31, 2009
Saturday, May 30, 2009
The last item do in this series of posts is to add the command to the right click menu. The first step is to get the dll file to be loaded or be demand loaded when Civil 3D is run. One way to do this is to add the dll to the registry. I got most of the information from Through the Interface blog. The completed text that I used on my machine is below:
Windows Registry Editor Version 5.00
"LOADER"="C:\\Program Files (x86)\\AutoCAD Civil 3D 2010\\C3DRemindersPack.dll"
"AddPointToPointGroup" = "AddPointToPointGroup"
Add the text to a text file and give it an extension of “.reg”. Change the “LOADER” location to match where you put the dll file, making sure to the path has the “\\” instead of “\”. Double click the file and it will add it to the registry. Editing the Windows registry can be dangerous, so beware. I did something wrong when testing it out and had to reinstall the Civil 3D.
Next we need to modify the cui to add the command to the shortcut menu. I unfortunately couldn’t find where to do that in a fresh install. So I downloaded David Garrigues Double and Right Click CUI on the Civil Engineering Community site (additional comments canned regarding this site) and added the right click customization. Follow the directions in the download to add the right click items. David did an excellent job creating them for Civil 3D objects. I believe he did this for Civil 3D 2007, so some of the commands won’t work in Civil 3D 2010.
Once completed go in and add a command to the CUI and it to the Shortcut Menu for the AECC_COGO_POINT.
I’ve added some of the other vb.NET posts to the dll file and gave the Pack it’s own webpage:
You can do the same steps above for the Surface Right Click Shortcut Menu, using the TIN and AECC_TIN_SURFACE shortcut. I didn’t set it up for the first pick option, so unfortunately the user will have to reselect the surface.
Friday, May 29, 2009
Thursday, May 28, 2009
In the last post I provided code on the main part of the code to add a point to a point group. In this post I’ll post some of the steps to create a form that prompts the user for which point group they want to use. The first thing to do is create the form by going to Project on the Menu bar and choosing Add Windows Form.
Then take items from the Toolbox and put it into the form. In my form I used a combo box to hold the list of point groups in the drawing. The button is used to give the user an opportunity to create a new point group.
Double clicking any of the buttons lets you go and modify the code. Each part of the form can get some code to do something. The code for this example is below:
Some of the code that fills up the combo box was in the other post. So now the code is compiled and is ready to go on the programming side. The compiled code may be downloaded here. In the next post I’ll add it to the right click menu in the cui.
If you want to try it out before I finish the posts, you can download the compiled file here, type Netload to load the file and type AddPointToPointGroup at the command line to run the code. This code will only work in Civil 3D 2010. I still have to figure out how to modify the right click customization in the cui, so that part won’t work yet.