Author Topic: C# and Civ3D where to start?  (Read 1885 times)

0 Members and 1 Guest are viewing this topic.

laztrezort

  • Guest
C# and Civ3D where to start?
« on: August 03, 2009, 03:08:34 PM »
Hello all, first time poster, I apologize if I've missed a FAQ or previous post that has already answered this...

I am completely new to developing for AutoCAD, but I have some existing code that I'd like to try to integrate into Civil3D (currently 2009).  My preference would be C# (after years of C++, managed code is like, well, candy :))  I downloaded and quickly perused the AutoCAD 2007 .NET Training labs, and everything looks pretty fairly straightforward.  However, it seems that the API they are documenting (ObjectARX?) does not expose Civil3D objects.  Am I correct about this assumption?  So that leaves a .NET wrapper around ActiveX, which I find to be less straightforward (and less documented, from what I've found).

Basically I need to expose Civil3D survey points in my app, everything else would be vanilla cad.

So my questions are:
1)  Am I correct that there are basically 2 APIs available, ObjectARX and ActiveX, both having .NET wrappers?
2)  Am I correct that ObjectARX is no good for Civ3D?
3)  If I must use ActiveX, are there any good resources/docs/examples using C# and .NET for interfacing Civ3D?  I figured out how to expose a command and do simple things with ObjectARX in about 30 mins, but after reading for a while I still have no idea how to do the same using ActiveX.

Thanks in advance for any guidance.

wannabe

  • Guest
Re: C# and Civ3D where to start?
« Reply #1 on: August 03, 2009, 04:43:52 PM »
On through-the-interface there are also other blogs such as the "the building coder". Maybe you can locate a blog on there that suits your niche.

Good luck

sinc

  • Guest
Re: C# and Civ3D where to start?
« Reply #2 on: August 03, 2009, 04:46:14 PM »
There's quite a bit of documentation.  It's all in the Help folder in the C3D installation directory.  There's also a number of samples in the Samples directory in the C3D installation directory.

Portions of C3D are accessible via a managed API, but it is just a small portion, and the majority of C3D API access is via Active X.  The API keeps changing, and the managed API is significantly larger in C3D 2010, but many items must still be accessed via Active X.

I also have some old source code available on this page:

http://www.quuxsoft.com/SincpacC3D_source.aspx

It's pretty old stuff, and much of it was done right when I started learning C#.  Eventually, I'd like to get some updated source code posted, but I'm not sure when that will be.  In the meantime, that source code can still provide quite a few samples of access to Civil 3D elements.

laztrezort

  • Guest
Re: C# and Civ3D where to start?
« Reply #3 on: August 03, 2009, 05:06:14 PM »
Thanks guys!  I'll keep digging, I just realized there are a bunch of docs installed in the civil3D folder.

@Sinc:  Thanks much, this looks exactly like what I need -- example code and project.  In fact, I immediately learned something by opening the project -- looks like I can mix ActiveX and ARX in the same project!  Don't know why I didn't think of this (duh).

Well, time to brush up on my ActiveX...

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8758
  • AKA Daniel
Re: C# and Civ3D where to start?
« Reply #4 on: August 03, 2009, 08:59:13 PM »
Welcome to theSwamp laztrezort

You can also mix Arx, Com and managed code in the same module via C++/CLI.  :-)