Sample Code for Civil Cogo Points

Sample Code for Civil Cogo Points

Punisher
Archived Account
2,026 Views
17 Replies
Message 1 of 18

Sample Code for Civil Cogo Points

Punisher
Archived Account
Can anyone assist me with some source code (C#) samples for accessing Cogo point groups and point information?
Please include the references needed.

I have been searching for information for a while, but cannot locate anything.

Thank you
John Evans
0 Likes
2,027 Views
17 Replies
Replies (17)
Message 2 of 18

Anonymous
Not applicable
Hi John,

The starting place for all VBA code for Civil 3D is in the

C:\Program Files\Autodesk Civil 3D 2007\Sample\Civil 3D API\Vba\

directories.


--

Laurie Comerford
CADApps
www.cadapps.com.au

wrote in message news:5257171@discussion.autodesk.com...
Can anyone assist me with some source code (C#) samples for accessing Cogo
point groups and point information?
Please include the references needed.

I have been searching for information for a while, but cannot locate
anything.

Thank you
John Evans
0 Likes
Message 3 of 18

Anonymous
Not applicable
Hi Laurie,
While this is correct, it doesn't quite answer John's request for sample
code in C#. The only sample provided for C# is how to connect to the Civil3D
environ.....

Jeff

"Laurie Comerford" wrote in message
news:5257507@discussion.autodesk.com...
Hi John,

The starting place for all VBA code for Civil 3D is in the

C:\Program Files\Autodesk Civil 3D 2007\Sample\Civil 3D API\Vba\

directories.


--

Laurie Comerford
CADApps
www.cadapps.com.au

wrote in message news:5257171@discussion.autodesk.com...
Can anyone assist me with some source code (C#) samples for accessing Cogo
point groups and point information?
Please include the references needed.

I have been searching for information for a while, but cannot locate
anything.

Thank you
John Evans
0 Likes
Message 4 of 18

Punisher
Archived Account
Laurie and Jeff,
Thanks for the input. I reviewed the code Laurie mentioned, and then pryed my way in until I could extract and modify the data in the AECC_COGO_POINTS.

In the event someone finds a good reference specifically for C# and Civil3d, please post it here or email 1punisher@cox.net

thanks,
John
0 Likes
Message 5 of 18

Anonymous
Not applicable
Hi John,
Were you able to do this in C# or in VBA? I ask because once I saw this post
I started examining what it would take to do this in C# I have something
now that accesses the points in a point group, but have not yet tried to
edit the points.

Jeff

wrote in message news:5259560@discussion.autodesk.com...
Laurie and Jeff,
Thanks for the input. I reviewed the code Laurie mentioned, and then pryed
my way in until I could extract and modify the data in the AECC_COGO_POINTS.

In the event someone finds a good reference specifically for C# and Civil3d,
please post it here or email 1punisher@cox.net

thanks,
John
0 Likes
Message 6 of 18

Punisher
Archived Account
In C#.
I am a C++ and lisp coder, but wanted to make the jump with .net for the future.

I get the point list by AECC database, or Point group.
I access and modify the data straight from the AECC database.

Thats as far as I have gotten. I am real weak in C#, but am learning quickly.
Any help you can offer is greatly welcomed.

John
0 Likes
Message 7 of 18

Anonymous
Not applicable
I would have to ditto what you said. I come from a strong lisp and a pretty
good VBA background. I've tinkered with C# but have been slowly trying to
move more to it. It helps to have people ask questions that make me want to
try it myself, as did your first post in this thread.

I think you will probably have a head start on me, having the C++
background. C# seems to be more similar to C++ than to VB/A

Good luck!
Jeff

wrote in message news:5259645@discussion.autodesk.com...

I am real weak in C#, but am learning quickly.
Any help you can offer is greatly welcomed.

John
0 Likes
Message 8 of 18

Punisher
Archived Account
C# is like taking C++ and mixing it with VB. THe casts are easier and less painful. Some of the new Object classes are nice as well.

I have been learning by pounding in C++ style calls until my compiler balks, and then researching the errors. That and the Autodesk COM tutorials.
0 Likes
Message 9 of 18

Anonymous
Not applicable
Hi,

I have no intentions of moving to C#. In the shorter term I'm staying with
VBA, because of background knowledge, experience and I have yet to run into
anything I need to do which I can't do with VBA.

When the Help system for .NET in AutoCAD becomes adequate, I might move, or
then again I might retire.

"Programming Microsoft Visual Basic .Net" by Francesco Balena and published
by Microsoft implies that the decision to use .NET in VB format or C# format
is dependent on the task at hand and each has minor differences in
capability, but for most practical purposes they are equal.

Speed between the two is also dependent on the task at hand and there is no
point arguing to use one or the other on general speed grounds.

--

Laurie Comerford
CADApps
www.cadapps.com.au

wrote in message news:5259677@discussion.autodesk.com...
C# is like taking C++ and mixing it with VB. THe casts are easier and less
painful. Some of the new Object classes are nice as well.

I have been learning by pounding in C++ style calls until my compiler balks,
and then researching the errors. That and the Autodesk COM tutorials.
0 Likes
Message 10 of 18

Punisher
Archived Account
Laurie,
I looked at the VB.net code sample today, and it is surprising alot like the C# code. The structures are so similar, just the variable casting is C++ style.
If I had knowledge of VB, I'd stay too, but I don't, and I like C coding. The choice to go to C# is simply to move forward (for AutoCAD's sake), and stay within the Language preference.
I suspect one could do more in AutoCAD using VB.net than a person in C#.net
0 Likes
Message 11 of 18

nzeeben
Autodesk
Autodesk
Language when doing .NET development has no bearing on the features you can
work with. Someone using C# can do the same as someone using vb.NET.
Nick
wrote in message news:5262566@discussion.autodesk.com...
Laurie,
I looked at the VB.net code sample today, and it is surprising alot like the
C# code. The structures are so similar, just the variable casting is C++
style.
If I had knowledge of VB, I'd stay too, but I don't, and I like C coding.
The choice to go to C# is simply to move forward (for AutoCAD's sake), and
stay within the Language preference.
I suspect one could do more in AutoCAD using VB.net than a person in C#.net
0 Likes
Message 12 of 18

Punisher
Archived Account
Nick,
You got any Civil 3d Code clips?
0 Likes
Message 13 of 18

nzeeben
Autodesk
Autodesk
I am making the push to C# myself right now. Just worrying about c# havent
gone to c3d with it yet. Everything else is VBA.
Nick
wrote in message news:5262716@discussion.autodesk.com...
Nick,
You got any Civil 3d Code clips?
0 Likes
Message 14 of 18

Anonymous
Not applicable
Laurie,

You should try out vb.net, it's really similar to VBA, except you have more tools and can make stand alone apps.

I have taken several vba routines and ported them over to vb.net without much work.

Check out the AU2005 class handouts on .net and you'll see some samples of what can be done with .net

good luck

take care
0 Likes
Message 15 of 18

Anonymous
Not applicable
Punisher,

You may want to dig up some vb.net samples for C3D, then google vb.net to c#.net conversion. You can find a few web sites that will translate code between vb.net and c#.net.

I started out on VB and will probably stick with vb.net since there really isn't any advantage to working in C# because .net is a level playing field for languages.

Of course I love a challenge so I'm sure I'll dive into c# eventually.

take care
0 Likes
Message 16 of 18

Anonymous
Not applicable
Check out the autodesk blog entry:

Developing Autodesk Civil 3D applications with .NET

http://through-the-interface.typepad.com/
0 Likes
Message 17 of 18

Punisher
Archived Account
I have the beta for the first run of a cogo compare program. It populates a pair of list views with point data from ascii files, ldt database, or Civil3d 2007 open dwg, and rips out the differences.
Next version will post differences with an option to go direct into any of the latter 2 origins.
0 Likes
Message 18 of 18

Anonymous
Not applicable
I am just learning the c# method of trying to solve some of the same problems. Did you ever post the code mentioned below?

I am going to attend the AU event in vegas. Any suggestions on who to see based on your experience with the discussion groups?

john
0 Likes