From where AutoCAD can load plugins?

From where AutoCAD can load plugins?

adam.krug
Advocate Advocate
11,073 Views
8 Replies
Message 1 of 9

From where AutoCAD can load plugins?

adam.krug
Advocate
Advocate

I have a plugin installed on my AutoCAD 2019. Installation required admin credentials which I have, but I'd like my colleague also to use it, who hasn't got the admin rights on his machine and IT complains as usual to install extra things. I thought I could simply modify its app bundle and and share the files (likewise I could do with Revit Python Shell plugin during times when there was a bug with its installer, and it was one of the solutions to fix it yourself).

 

I can see that the plugin has its files on ProgramFiles\XYZPluginFiles folder but I can't see any file which instructs AutoCAD that it should load the plugin from there... I checked all the locations from this help page but I couldn't find its appbundle.

 

Where else can I look?

 

The plugin is around 7 - 10 years old (not sure), it that helps... During installation I could decide on which AutoCAD (or its vertical) I want to install it.

0 Likes
Accepted solutions (1)
11,074 Views
8 Replies
Replies (8)
Message 2 of 9

tbrammer
Advisor
Advisor

Basically AutoCAD can load plugins from any folder.

If a plugin depends upon other DLLs it must be ensured that those DLLs can be found. On windows DLLs are always searched in

  • the directory of the EXE which is the acad.exe in this case.
  • the system directory and the windows directory %WINDIR%
  • the current directory
  • the directories specified with %PATH%

In general there are multiple loading mechanisms. See this posting for example.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 9

adam.krug
Advocate
Advocate

thanks @tbrammer 

 

Okay but still AutoCAD should first know that it should load particular file as plugin right? That is for example the job of ComponentEntry node of PackageContents.xml of app bundle.

 

So in this case the files are all located in ProgramFiles\XYZPluginFiles but how my AutoCAD 2019 knows that it should load files from there, and which of them is the entry point?

0 Likes
Message 4 of 9

norman.yuan
Mentor
Mentor

If your plugin app, which can be any of *.arx, *.dll (C++, or .NET), or .lsp..., is packaged as bundle, it is meant for AutoCAD to automatically load it, either on startup, or on demand when its command is triggered. The bundle can only be in following locations:

 

"C:\Program Files\Autodesk\ApplicationPlugins\"

"C:\Program Files (x86)\Autodesk\ApplicationPlugins\"

"C:\ProgramData\Autodesk\ApplicationPlugins\"

"C:\Users\[username]\AppData\Roaming\Autodesk\ApplicationPlugins"

 

First 3 locations need local admin for write-access (copying your bundle to), but the last one, I believe, does not need local admin for current user to copy your plugin into there.

 

You can also automatically load your plugin on AutoCAD startup with acad.lsp, by adding statement like

(command "NETLOAD" "[file path]") or (command "Appload" "[file path]").

 

Just remember, other than "C:\Program Files ...", any other location is considered "not trusted". If AutoCAD's "SecureLoad" is enabled (by default), you need to add the plugin's location to "Trusted Locations" to avoid security warning pop-up every time the plugin is loaded.

 

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 9

adam.krug
Advocate
Advocate

thanks @norman.yuan for your help.

 

For the mentioned plugin none of these folders contain its app bundle.

 

For arx plugins is there any different way to load them on startup (not with app bundle)?

0 Likes
Message 6 of 9

Alexander.Rivilis
Mentor
Mentor
Accepted solution

Yes. From registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\RNN.N\ACAD-XXXX\Applications

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\RNN.N\ACAD-XXXX:YYY\Applications

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\RNN.N\ACAD-XXXX:YYY\Applications

 

 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 7 of 9

adam.krug
Advocate
Advocate

thank you so much @Alexander.Rivilis , you made my day 🙂

0 Likes
Message 8 of 9

norman.yuan
Mentor
Mentor

Well, editing Registry directly is basically the same thing as creating bundle and place the bundle in "...\ApplicationPlugins\" folders: you are subject to the same local admin permission for HKEY_LOCALMACHINE... So, if you have already had the bundle, why why bother asking IT to edit the registry rather than ask IT to copy the bundle?

 

using HYEY_CURRENTUSER would be the same as placing the bundle in "C:\ProgramData\[user]\.....\ApplicationPlugins\", where there is no need for local admin permission, but only the current user can freely access it.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 9 of 9

adam.krug
Advocate
Advocate

@norman.yuan I don't have to bother anybody, I mentioned I have local admin permissions, so I dived into the registry, found the entries for the plugin and found out which of the files is the starting point of the app.

 

Now I can either create the app bundle and put it to "C:\ProgramData\[user]\.....\ApplicationPlugins\" of my colleague or just instruct him of how to load it using APPLOAD command (I know which file is the starting point).

 

I didn't have the app bundle, if I had I would know which file is the starting point I should use for loading.

0 Likes