In our last exercise, we completed building our code. How do we use what we built? Let’s complete our series by loading our code, testing, and debugging it.
In our first exercise, we set up our debug property to launch AutoCAD Civil3D upon debug. Since that is already setup all we have to do is Start Debug. This compiles our code into a dll and launches AutoCAD Civil3D.
Once AutoCAD Civil3D is launched, then go find and open a drawing with alignments in it.
From this open drawing, if you type in our new command, “AlignmentInfo” nothing happens. That is because even though VS compiled our dll and launched AutoCAD Civil3D to debug our dll, it did not LOAD our dll. We have to do that manually.
Simply type “NETLOAD” at the command line. Browse to your project and go to the “[Project]\bin\Debug\” folder. From there you will find our compiled dll. The name of the compiled dll is the assembly name, which in our case is “TestCivil3DApplication”. Click on the dll and choose open. Now from the command line type in our new command, “AlignmentInfo”.
Once you do, you should see the following dialog box.
The treeview lists all the alignments and then under the alignment node, all the properties we derived from the alignment object.
What if you want to automatically load your dlls? You can see Kean’s blog about how to do that here.
That is is it for this series. I hope you were able to pick up a point or two.
Tune in next week for a new series (Want to define what the new series will be on? Join the Civil3D forums and post what you want to hear about.).