.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One vb ap for both AutoCAD and Civil 3D... is it possible?

7 REPLIES 7
Reply
Message 1 of 8
ackypucky
692 Views, 7 Replies

One vb ap for both AutoCAD and Civil 3D... is it possible?

Hello:

 

I am writing a vb.net app that needs to work with both regular AutoCAD 2011 and also Civil 3D 2011.  To keep things simple I would really like to avoid having to maintain two separate versions of the code.

 

 

If I do this, will the Civil 3D references cause issues when the program is run in regular AutoCAD (without Civil 3D installed), or will they quietly be ignored unless a command is used that requires them? 

 

Thanks

 

Dale

 

7 REPLIES 7
Message 2 of 8
caddzone
in reply to: ackypucky

AFAIK, that wouldn't be possible.



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Message 3 of 8

What are you trying to do? If your app only uses plain Autocad functionallity then it will work on both platforms, if does call Civil3D functionallity then you might possibly get around the problem with late binding your references after you detect if Civil3D is installed (don't know this for a fact but I've done this with other non-Autodesk applications).

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 4 of 8

Hi Michael:

 

I think your suggestion using late binding might work.  I want my utility to work with basic autocad geometry like lines, arcs and polylines, and if the user is running Civil 3D, I want it to work with parcels as well.  I've added the Civil 3D references and it seems to run okay on a machine with only AutoCAD installed, as long as I don't try to access any Civil 3D objects.  I was hoping to see if anyone else has done something similar which would back up my own findings.

 

Dale

 

Message 5 of 8
ackypucky
in reply to: ackypucky

Of course, the next question is.... how to detect if Civil 3D is running.

 

Dale

Message 6 of 8

Are you running external to Acad (through COM) or internal via NETLOAD?

 

I believe either way you can use the Application.GetInterfaceObject method to see if Civil3d is installed.

 

Once you get a reference to the Acad application you can see if GetInterfaceObject("AeccXUiLand.AeccApplication.8.0") returns a value (8.0 is C3D 2011, 7.0 is C3D 2010).

 

You should throw a Try Catch around the attempt to handle any exception.

 

 

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 7 of 8
caddzone
in reply to: ackypucky

Since you posted in the .NET forum, rather than the VBA/ActiveX forum, I assume you were talking about managed APIs, not COM.

 

With COM it's quite different, and you might get some additional advice in the aforementioned forum or the Civil3D customiization forum.



AcadXTabs for AutoCAD
Supporting AutoCAD 2000-2011


Message 8 of 8
ackypucky
in reply to: caddzone

Actually, I'm trying to make the entire app a managed app, however, Civil 3D is not yet fully converted over to .net api yet.

 

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost