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

How to get this code to run

11 REPLIES 11
Reply
Message 1 of 12
neilyj666
2062 Views, 11 Replies

How to get this code to run

Can anyone give me any clue how to get the code in this blog post to run in Civil 3D??

 

 

http://through-the-interface.typepad.com/through_the_interface/2011/10/delete-all-but-current-annota...

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
11 REPLIES 11
Message 2 of 12

The example is C# (C Sharp) programming code that must be compiled into a dynamic link library (dll) that can be netloaded into Civil3D (or any ACad based program).

 

You would need at the minimum Microsoft Visual Studio Express get started with this example.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 3 of 12
neilyj666
in reply to: neilyj666

Thanks Mike - that's what I suspected, hopefully a .NET guru will grasp this and oblige.........

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 4 of 12

Neil,

I figured since this is posted code I could go ahead and compile it for you (no support though!).

 

Should run on 2010 and later (But I only have 2012 installed so I can't test on other versions).

 

To use it you'll need to run the netload command and pick the attached dll file.

Then on the command line enter the command: AIOBJECTSCALEREMOVEOTHERS

 

Hope it works but is provided as is.

 

Mike

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 5 of 12

Thanks for this (I downloaded the Express C# studio from Microsoft just for a look and was totally lost...!!!) - I'll check it out tomorrow

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 6 of 12
Anonymous
in reply to: michael.robertson

I am new to C#. When I tried to paste the original code into visual c# express and then compile, it did not seem to work after netload.  How much "fidling" does one have to do to use code like this?

Message 7 of 12
tcorey
in reply to: Anonymous

I recommend you copy this thread to the Civil 3D Customization group. That's where the programmers hang out...



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 8 of 12
michael.robertson
in reply to: Anonymous

What type of project did you create to paste your code into? Should be a C# Class library,

 

Is your project compiling?

 

Not familiar with the Express version of Visual Studio but in your Project Properties, on the BUild Tab the "Platform Target" must either be set to "Any CPU" or match the bit version of Civil3D you are running the app in (either 32 or 64bit).

 

Did you download the ObjectARX SDK also? You'll need this so you can create the correct references in your project.

 

Do you get an error when you netload or when you try to run the command?

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 9 of 12
Anonymous
in reply to: neilyj666

I pasted the code into c# express 2008 with the Autocad wizards loaded. 

 

I started a new project with the Autocad wizard, then attempted to paste it in.  I was confused as to where to insert the code in the project, and just deleted all, then pasted over.  This compiled and I netloaded the dll, but autocad would not recognize the command.

 

I then started a "create library" project in c# express and then pasted in the code. After referencing the autocad dlls the code then compiled correctly and ran in autocad!  Problem solved............sort of.  I still do not know how to use the Autocad Wizard project, to make use of the same code. 

 

I am going to view all the devTV vids to see if I can learn more.

 

Thank you for your reply.

Message 10 of 12
michael.robertson
in reply to: Anonymous

Like another poster said you'll do better posting these types of Questions in the Customization forum especially since you are dealing with plain AutoCAD programming right now. If you get to specific C3D programming questions later you might post those here.

 

I've actually found that when I was getting started the wizard actually made the whole thing look more confusing than it need to be, the project created by the wizard had a lot of stuff you may never use.  I've been doing C3D programming now for about 5 years and still don't use the wizard.

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 11 of 12

Hi All,

 

I'm running (R) 2014 and just tried this. Wondering if you've had any luck running this in (R) 2014?

 

Thanks,

Message 12 of 12
odoshi
in reply to: pmascaro

Hi Paul,

 

From the age of the posts, it looks like it was compiled before AutoCAD 2013, which had an API change, so I doubt it will NETLOAD. (I didn't try it).

 

The code is probably still good, but if you wanted to compile your own DLL, you'd need 3 Autodesk References in the C# project, not 2 as before 2013.

 

accoremgd.dll

acdgmgd.dll

acmgd.dll

 

They come with AutoCAD.

 

HTH,

Mike

 

Mike Caruso
Autodesk Certified Instructor 2014
AutoCAD/Civil 3D Autodesk Certified Professional 2014, 2015, 2018
www.whitemountaincad.com

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report