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

How to do an "Add In" in .Net for Autocad

1 REPLY 1
Reply
Message 1 of 2
coberto
274 Views, 1 Reply

How to do an "Add In" in .Net for Autocad

I made an Add In in .Net, and the program that start with the Add In is Autocad. But I can´t connect.
In the class Connect.vb i put a break point in Public Sub OnConnection, but the compiler never pass for that. I know that some keys in the Windows Registry are necessary. Please Help..!!!!!!

Thanks
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: coberto

You are right, you must load the assembly in AutoCAD.
To do this, you can write netload in autoCAD commandline and then select the dll that represents your addin.

Another option is to write something in the registry. Should be like this:

\\HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\releaseNum\
ACAD-ProductID:LocaleID\
Applications\
YourApplicationName\
DESCRIPTION: REG_SZ: User Friendly App Name
LOADCTRLS: REG_DWORD: loadReason
LOADER: REG_SZ: pathFileName
Commands\
GlobalCommandName1:REG_SZ:LocalCommandName1
GlobalCommandName2:REG_SZ:LocalCommandName2
GlobalCommandName3:REG_SZ:LocalCommandName3
GlobalCommandName4:REG_SZ:LocalCommandName4
GlobalCommandName5:REG_SZ:LocalCommandName5
Groups\
GroupName:REG_SZ:GroupName
...

For AutoCAD 2006:
releaseNum = R16.2
ACAD-ProductID:LocaleID = ACAD-4003:409

loadReason:
0x01 - Load the application upon detection of proxy object.
0x02 - Load the application upon AutoCAD startup.
0x04 - Load the application upon invocation of a command.
0x08 - Load the application upon request by the user or another application.
0x10 - Do not load the application.
0x20 - Load the application transparently

Usually it is 0x02, but depends on what you need

pathFileName = must include the full path and file name of the module that AutoCAD should load first. The loader module is subsequently responsible for loading any other modules that make up the application.

For example, my addin writes this in the registry (I am giving you the code in C#):

string acadAddinKey = @"Software\Autodesk\AutoCAD\R16.2\ACAD-4003:409\Applications\MPMAcad2006PluginApplication";
RegistryKey addinKey = Registry.LocalMachine.CreateSubKey(acadAddinKey);
addinKey.SetValue("DESCRIPTION", "Matrix MPM AutoCAD Plugin");
addinKey.SetValue("LOADER", "D:\\Program Files\\Autodesk\\MDT 2006\\MM\\MM.Acad2006Plugin.Core.dll");
addinKey.SetValue("LOADCTRLS", 2);
addinKey.SetValue("MANAGED", 1);

I hope this helped you. I suggest you use the ObjectARXDocumentation.

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