Bundle & Distribute AutoCAD API plugin

App Bundle (reference video): An App Bundle is a self-contained directory which contains all the files an application, plugin or script needs in order to run in an Autodesk product. Since the App Store adopted this model for app distribution ... for All Autodesk products.

Bundle AutoCAD API

Once you have successfully created the AutoCAD Plugin and Ribbon, you can bundle the build files and the cuix file to share your custom commands and UI that you created.

You can follow the instructions in this video starting from 01:09:12

To do so, you need to create a special folder called "PluginName.bundle" which should contains

  1. build files,

  2. .cuix file &

  3. another file called PackageContents.xml

which needs to be placed under C:\ProgramData\Autodesk\ApplicationPlugins. This is where AutoCAD looks for any available plugins that the user has installed.

Screenshot of the .bundle folder for a plugin

Note that it's a best practice the place all your build files in a folder called "Content" in the "PluginName.bundle" folder

Below is a sample content that need to be present in the PackageContents.xml

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD" Name="PluginName" Description="Plugin Description" AppVersion="0.0.1" FriendlyVersion="0.0.1" ProductType="Application" SupportedLocales="Enu" AppNameSpace="appstore.exchange.autodesk.com" Author="Anwesh Gangula" HelpFile="./help.html" OnlineDocumentation="vConstruct.com" ProductCode="{030335ce-ee6b-4cd9-84d0-0afa479ed4ac}" UpgradeCode="{08abfbe3-2dab-45aa-817b-68e70212f494}" Icon="./icon.ico">
  <CompanyDetails Name="Anwesh Gangula" Email="myEmail@gmail.com" Url="anweshgangula.com" />
  <Components Description="2017-2023">
    <RuntimeRequirements OS="Win32|Win64" Platform="AutoCAD*" SeriesMin="R19.1" SeriesMax="R24.2" />
    <ComponentEntry AppName="PluginName" Version="0.0.1" ModuleName="./Contents/PluginName.dll" AppDescription="Commands Description" LoadOnCommandInvocation="True" >
      <Commands>
        <Command Global="OpenWPFWindow" />
        <Command Global="AdskGreeting" />
      </Commands>
    </ComponentEntry>
    <ComponentEntry AppName="PluginName" Version="0.0.1" ModuleName="./PluginName.cuix" AppDescription="Customization description" LoadOnAppearance="False" LoadOnAutoCADStartup="True" />
  </Components>
</ApplicationPackage>

Additional References

  • When you create a new PackageContents.xml file for your bundle, you have to create a new GUID (menu Tools > Create a Guid) as ProductCode and an another one as UpgradeCode, then, for each new version of your application, you should create a new GUID for the ProductCode but never change the UpgradeCode one.

  • check out the following link to update the SeriesMin & SeriesMax as per your requirement

    • in the example above, R19.1 is for AutoCAD2014 & R24.2 is for AutoCAD2023

Sample Code

I've published an example repository on GitHub which you can clone and test this functionality