Ad

Friday, May 28, 2010

Sincpac C3D Source Code

Recently Quux Software released the Sincpac C3D Source Code for Civil 3D. If your an amateur programmer like me I’d suggest you download it and check out the features. If your just starting out being an amateur programmer of Civil 3D then this post is for you. In this post I’ll go over how to get the code set up to work and some of the benefits of using the code as a starting point.

The first thing you need is an Integrated Development Environment program. If your just starting out I’d suggest downloading Microsoft Visual Studio Express for c#. If your planning on doing this more than just occasionally I’d get Visual Studio. (If your using Microsoft Visual Studio Express 2010 you may need to change the .NET framework to 3.5 from the default).  The Sincpac is written in c#, which is quite different than the VBA and vb.NET that I usually blog about.

Once you’ve imagedownloaded the source code and Visual Studio you’ll need to open a solution based on what version of Civil 3D you are building for. The Sincpac comes with solutions for 2008, 2009, 2010 & 2011.  Each solution utilizes the same code in the AcadUtilities, C3DUtilities & SincpacC3D folders. This makes it easy to have code for your routines in one place and makes it easy to compile code for each version of Civil 3D.

For this example I’m working with Civil 3D 2010, so I’ll open QuuxFree2010SNAGHTML2a78b8. Once open you may get warning messages. It should be OK to press the OK button. You’ll then get another error message, go ahead and change the option to Load project Normally. You’ll have to press it three times since there is three SNAGHTML2cb71fassociated solutions with the main solution.

Within the Sincpac there is three solutions. The SincpacC3D 2010 Free Edition contains the commands that the user calls.image This, or another solution, is where you’d place your commands or modify the existing ones. The AcadUtilities2010 and C3DUtilities2010 contain code that helps accomplish the tasks in the SincpacC3D 2010 solution.

For instance the  AcadUtilities contains the Formatter Class. This class helps convert doubles to the correct number format. For instance you can convert a radian value to the correct angle format using the AngleToString.

SNAGHTML330686

In order to compile the code, most likely, the references need to point to the correct location for all three solutions. Thankfully you only have to do this step the first time out.  I find the easiest way is to add a reference folder location. I’ve chosen to use the Civil 3D folder, but it is recommended to use the ObjectARX files, downloadable from the ADN site. Download it and then point the reference folder to that location instead of what I did in the video.

Now you can build the solution, choose to build the entire solution. Now open Civil 3D and use Netload to load the dll. The dll may be found here for a Build Solution:

\FreeEditionV2\SincpacC3D\bin\Release2010

and here for a Debug Release:

\FreeEditionV2\SincpacC3D\bin\Debug2010

The download page has some information how you can have the dll loaded when Civil 3D starts so you don’t have to netload it each time you want to debug a program.

The commands that come with the Sincpac code is: BRKPT, CHELEV, FREEPT, HIDEBND, LABLAY, MOVEPOINTS, NEXTPT, PT2FEATURE, PT2PROFILE, ROTATEMARKERS, ROTATEPOINTS, SELPTGROUP, SGOBJECT, SGRD, SPHELP, SPSETTINGS, STAKEFEATURES, STAOFF, USEDPT, & ZOOMPT. You can find more information about the commands on the Sincpac site.

In the next post I’ll start to add a custom command, using this code as a starting point, to create Civil 3D points from blocks and text.

***Disclaimer: I have received access to the full version of the Sincpac without having to pay for it, which may need to be disclosed due to certain laws of the United States.

1 comment:

Lou said...

Sweeeeeeeet. I hope I have time to look at this. See you next week!

LinkWithin

Blog Widget by LinkWithin