.NET

Reply
New Member
coberto
Posts: 1
Registered: ‎03-21-2006
Message 1 of 2 (127 Views)

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

127 Views, 1 Replies
03-21-2006 11:05 AM
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
Active Contributor
karenina
Posts: 32
Registered: ‎10-07-2004
Message 2 of 2 (127 Views)

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

04-19-2006 03:56 AM 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.