Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sample .NET Source Code

3 REPLIES 3
Reply
Message 1 of 4
Sinc
336 Views, 3 Replies

Sample .NET Source Code

The new Sincpac-C3D 2008 Free Edition v1.0 has been released, along with new Source Code! See Quux Software for details and download.

There are three projects included in one solution (using VS 2008 C# Express). Two of the included projects work only with Civil-3D, but the AcadUtilities one should be using only the core managed DLLs, and should work in any Autodesk product (although I haven't tried them in anything but Civil-3D). Obviously, you would need to relink the references, and then try to figure out how to use the code by looking at the other two projects. At some point, I'll try to get a Vanilla-only download put together with some sample commands.

This library is currently in the process of being shifted over from a somewhat clunky approach that I first used, into a much-nicer component-based approach. As such, it is subject to change significantly in the future. Parts of the frameworks are still implemented in a "messy" way, and other parts are implemented with the new components, so you can see the difference by comparing different commands. It is much easier to customize Autocad when you can simply grab a combo box that lets the user select a layer by name and/or pick a layer in the drawing and/or create a new layer, and just drag-n-drop it onto a form, and have all that functionality working without writing any code. All that grungy stuff involving managing lists in combo boxes, etc., is all done once, in the components, and then just drag-n-dropped into everything else.

Eventually, I'll also get some measure of documentation put together, as well. And it is all written in C#, so you VBers need to translate if you want to use it. But if you are trying to figure out how to customize an Autodesk product with .NET, you may find it very useful. And it is being released under a very loose license, so you may even use it in commercial development, with only the lightest of restrictions. This is a gift to the community, in the interests of furthering the general knowledge in the community at large.

Enjoy!
Sinc
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Sinc

Thank you Mr. "sinc".

Bill

wrote in message news:5857432@discussion.autodesk.com...
The new Sincpac-C3D 2008 Free Edition v1.0 has been released, along with new
Source Code! See Quux Software for details and download.

There are three projects included in one solution (using VS 2008 C#
Express). Two of the included projects work only with Civil-3D, but the
AcadUtilities one should be using only the core managed DLLs, and should
work in any Autodesk product (although I haven't tried them in anything but
Civil-3D). Obviously, you would need to relink the references, and then try
to figure out how to use the code by looking at the other two projects. At
some point, I'll try to get a Vanilla-only download put together with some
sample commands.

This library is currently in the process of being shifted over from a
somewhat clunky approach that I first used, into a much-nicer
component-based approach. As such, it is subject to change significantly in
the future. Parts of the frameworks are still implemented in a "messy" way,
and other parts are implemented with the new components, so you can see the
difference by comparing different commands. It is much easier to customize
Autocad when you can simply grab a combo box that lets the user select a
layer by name and/or pick a layer in the drawing and/or create a new layer,
and just drag-n-drop it onto a form, and have all that functionality working
without writing any code. All that grungy stuff involving managing lists in
combo boxes, etc., is all done once, in the components, and then just
drag-n-dropped into everything else.

Eventually, I'll also get some measure of documentation put together, as
well. And it is all written in C#, so you VBers need to translate if you
want to use it. But if you are trying to figure out how to customize an
Autodesk product with .NET, you may find it very useful. And it is being
released under a very loose license, so you may even use it in commercial
development, with only the lightest of restrictions. This is a gift to the
community, in the interests of furthering the general knowledge in the
community at large.

Enjoy!
Message 3 of 4
mstg007
in reply to: Sinc

Sinc,
Was programming this commands hard to do, or was it not easy, but pretty basic to do? Thanks again for sharing the application!!!:)
Message 4 of 4
Sinc
in reply to: Sinc

Not exactly sure what you're asking...

Creating this library took quite a bit of effort, partly because of the lack of examples and the limited state of the API docs, partly because of the messy nature of the API and C3D's lack of a .NET API, partly because I just started learning C# and .NET, and partly because it just took some time to build up to these design patterns from the low level of the API access.

That's the main reason I wanted to release them to the general public, even though I'm told I'm crazy for doing so. They can provide an invaluable learning source for others. And I think we need to get this idea out there of an SDK that lets us drag-n-drop all these common elements into an application, rather than working at the same level as the API.

This is still an early version of what will eventually exist. It's missing many things. And I'm already looking at ways that this can be improved. For example, right now there are Forms components and CommandParameter components in this framework. The Forms components can be drag-n-dropped into a form, but then they must be hooked to the CommandParameter via code. This is worlds faster than writing all the code from scratch, but I think it can be improved. For example, there might be a way of using components that are not user controls to remove the need to write this "linking" code, possibly by incorporating some reflection elements or something. It's something I still need to work out. So this is probably only one step along the way. But it's a significant one, for anyone who can dig through a bunch of undocumented code... 🙂
Sinc

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report