Customising add-in load behaviour via PackageContents.xml

Customising add-in load behaviour via PackageContents.xml

Amy.taylor
Enthusiast Enthusiast
1,597 Views
1 Reply
Message 1 of 2

Customising add-in load behaviour via PackageContents.xml

Amy.taylor
Enthusiast
Enthusiast

I am trying to control the loading behaviour of add-ins for AutoCAD.
Especially of two unsigned add-ins which evoke a security warning on loading. (Signed apps don't incur this issue so don't cause me any problems).

Based on my limited knowledge I believe that add-ins can be loaded at three times:
-On application startup.
-On drawing startup.
-On add-in selection.

Steps I have taken:
- I have added file location to trusted paths.
- I have attempted to edit the PackageContents.xml but my uneducated guess only served to cause AutoCAD to crash.

Can anyone advise what switched to change and to what value in the PackageContents.xml files to cause add-ins to load only when called, not on either application startup or drawing startup.
Else, can you direct me to a resource which will inform how to do it or why it can't be done.

Many thanks

0 Likes
1,598 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant

Hi,

 

The .bundle folder of the plugin have to be located in one of the Autodesk\ApplicationPlugins folder (typically %AppData% or %ProgramData%).

By default, they're "trusted folders".

 

You can edit the 'LoadReasons' in the PackageContents.xml folder but this have to be done according to the application type (e.g., an AutoLISP application have to be loaded for each document, a .NET application only need to be loaded at startup).

If you want to set the 'LoadReasons' to LoadOnCommandInvocation, you must include a ‘Commands’ element which contains the custom command names (this only applies to .NET and ARX applications).

 

You can find all details about the Autloader mechanism in the Autodesk Autoloader White Paper.

 

Anyway, if you click "Always load" in the warnig dialog, it should not show up anymore.

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub