Motivation #
PackageContents.xml is the meta file for AutoCAD/Civil 3D plugin, that tells AutoCAD how to auto-load your plugin.
If you can Netload your plugin DLL, but can’t get AutoCAD to autoload it, then most likely you don’t set up this xml file correctly.
The plugin setup #
First, your plugin folder must end with .bundle, and Autodesk will scan the following folders to load all the plugins inside .bundle folder.
C:\Program Files\Autodesk\ApplicationPluginsC:\Program Files (x86)\Autodesk\ApplicationPlugins%AppData%\Autodesk\ApplicationPlugins
Inside the .bundle folder there will be a PackageContents.xml file. As noted before, this is the file that will determine whether auto-load is successful.
Sample of a XML file #
<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage
SchemaVersion="1.0"
AppVersion="1.0"
Author="Genieko Sdn Bhd."
ProductCode="{F7E8A1D5-6B9C-43F0-82C4-0A9D2B6E5C8F}"
UpgradeCode="[Add Unique Plug-in GUID Here]"
Name=".Genabler"
>
<CompanyDetails
Name="Genieko Sdn Bhd."
Phone="Genabler"
PhoneEsp="Genabler"
Url="civilwhiz.com"
UrlEsp="civilwhiz.com"
/>
<!-- https://www.cadforum.cz/en/products.asp?prod=Civil+3D -->
<Components>
<RuntimeRequirements Platform="Civil3D" OS="Win64" SeriesMin="R25.1"/>
<ComponentEntry
AppName="Genabler"
ModuleName="./Contents/GenablerPlugin.dll"
/>
</Components>
</ApplicationPackage>
So what’s important? #
From what we can tell, what is important is the <Components> section.
Especially the AppName field. You have to ensure that the AppName is unique among all plugins. If it clashes with another plugin, then one of them may not be loaded at all.
The fields in <ApplicationPackage>, on the other hand, aren’t important at all. You can leave ProductCode, UpgradeCode and even Name unchanged. AutoCAD doesn’t seem to care whether they are unique or not among the plugins.
