Back

Viva La Revolution! Start Your Own Country with Content Pack Creation

Have you ever dreamed of starting your own country? Perhaps your aspirations are a bit more humble and you would be content to deploy multiple AutoCAD® profiles within your company. In either case, this article will explain the basic anatomy of a content kit for use in Autodesk deployments. We will be looking at AutoCAD® Civil 3D® 2015 as our example; however, the same principal can be used for base AutoCAD and related vertical applications.  

This article will explain using content kit XML files to set AutoCAD profile paths. This article is targeted to CAD administrators who are already very familiar with creating Autodesk product deployments and are comfortable with making Windows registry changes.

Why a Content Pack?

If you have installed an AutoCAD-based product in the past, you may be familiar with the following portion of the setup (Figure 1).

Figure 1

In some cases, you can modify the search paths and file locations upon install. These are the paths that will become part of the AutoCAD profile upon installation. This method has several drawbacks, however.  The first drawback is that you can only set up one configuration at a time.  If you have multiple departments at your company that use different templates or tool palettes, for example, this interface does not allow for alternate profiles.  Another drawback is that the Search Paths and File Locations interface is hidden in the Civil 3D 2015 installation.

Using a Content Pack

Content packs are added to a deployment in the individual product configurations.

Products that can use Content Packs are:

AutoCAD® Architecture
AutoCAD® MEP
AutoCAD® Civil 3D®
AutoCAD® Map
AutoCAD® Plant 3D
Autodesk® Revit® Architecture
Autodesk® Revit® Structure
Autodesk® Revit® MEP

Figure 2

To add content to a deployment, you will click Add Content and browse to the XML file.  If you have created your own content pack and the name of the pack does not appear in the above dialog after you select it, the culprit is an error in the XML file.  Check for unclosed tags, missing nodes, or a non-coded “less than” symbol in the body of the XML (more detail on this later in the article).

Anatomy of a Content Pack

A full content pack comprises several pieces. The main piece is an XML file, which sets the name of the profiles you are adding and sets search paths, file locations, and can set any option found in the AutoCAD Options dialog. The content pack XML generates the AutoCAD profiles and registry settings found in each profile.  You can create multiple profiles with one XML file; however, it is simpler to make a new content XML file for each profile.

Figure 3

An optional component of a content kit is the folder containing content.  This could be custom templates, plot styles, color tables, tool palettes, or any other files you would like copied to a user’s local machine. Content must be in the form of compressed CAB files. If your shared content is stored on a network location, then it is better to omit the CAB files. Creation of CAB  files is beyond the scope of this article, but be sure to check out my blog (http://civil3detcetera.blogspot.com/) for future articles where I will be discussing CAB  creation in more detail.

Creating Your Content XML File

When working with any XML file, I recommend using a special editor to aid your work. My favorite tools are XML Notepad and Notepad ++.  XML Notepad is great for validating the format of your files and for adding multiple lines of profile data.  If you run into problems adding the content pack to the deployment, try opening it in XML Notepad.  If XML Notepad can’t parse the file, it will tell you the exact location and nature of your error.

Notepad ++ is a more general editor that color codes the different components, but otherwise behaves like Windows Notepad.  I like this tool for comparing my content pack with the out-of-the-box examples, because it does not hide any of the formatting.

The best starting point for your own content XML files is to examine some existing ones. After you have downloaded and extracted the files for your install, you can find the out-of-the-box localization files in C:\Autodesk\Autodesk_IDSU_2015_English_Win_64bit_dlm\Content\en\.

Content Pack in Detail

Open C3D_CONTENT_ANZ.XML, for example. This is the content file for Australia and New Zealand.  Let’s examine each line and what the lines mean. Note that line numbers appear because the file is being shown in Notepad ++. Line numbers may vary depending on the editor you use.

Lines 1 and 2 are the same for all XML content files and can be copied directly to your file from any of the examples.  Lines 3 through 9 are part of the Identification node. The Name element (line 4) is what you will see in the installation interface when you add content to the deployment.  Line 5 is a description that is only used in the XML file (and not seen anywhere outside the file).  The group in line 6 indicates the type of data you are adding.  If you have a CAB file, lines 7 and 8 tell the installer where the data is located.  If you are not using a CAB file, these can be omitted.

Figure 4

Line 10 is the inheritance.  This line is extremely important for making sure your content pack picks up settings from the default Civil 3D content.  This indicates which content packs are related. The order in which you add these makes a difference, because duplicate settings will get superseded by the content pack listed last, which in turn will be superseded by any settings in the XML file you are editing.  This makes sure that the CAB files for the inherited content packs get extracted.

Lines 11-14 list application defaults.  The settings here show that the AutoCAD profile called <<C3D_ANZ>> will be loaded by default.  Note that because XML uses the “less than” sign for its own purposes, the &LT code is used to explicitly denote the < symbol (see
Figure 5).

Figure 5

Lines 15-18 are the shortcut definitions. These lines are optional in your content file. There are two entries for this in the ANZ example because the install will create the desktop shortcut and the start menu shortcut.

Figure 6

Now for the main reason you are reading this article: the registry settings! An AutoCAD profile is really just a list of Windows registry entries.  Lines 19-27 in the ANZ define the profile and describe how it differs from the out-of-the-box profiles.  Any profile registry setting can be added here. A good file to examine for examples of all of the registry settings can be found in the …content\en folder under C3D_Profile.xml.  The inheritance listed here is the profile inheritance (not to be confused with the content pack inheritance listed in line 10).  These define the registry entries that will be included with your profile.  For example, say you want to change the default Automatic Save File Location on install. If you load the ACAD_Profile and don’t redefine it, you will get the default location of the user-specific temp folder.  If you add an entry in these registry settings, your profile will override the AutoCAD ones. The line in the XML file will look like this:

<ProfileEntry Name="TempDirectory" Subkey="General Configuration" Type="REG_SZ">D:\TEMP</ProfileEntry>

Figure 7

Finally, the Files portion of the XML file specifically references the compressed CAB files that contain data.  Not all CAB files are created equally, so this portion is best left untouched. In your own files, you can remove everything in the Files node, or turn it into a comment by adding !- -  just after the less than symbol  (see line 20 of the ANZ file for an example of a comment).

Be sure to keep the </DocumentRoot> tag because this signals the end of the file.

Figure 8

Results and Conclusion

After you deploy your product with a custom content pack, you will see your profile listed in the AutoCAD options area.  Before pushing out the deployment to your users, check that your desired changes appear in the AutoCAD options dialog box.

Figure 9

For more examples of custom content pack XML files and a discussion about creating CAB files, visit my blog (http://civil3detcetera.blogspot.com/).

Louisa “Lou” Holland is a civil engineer and support specialist for Autodesk serving enterprise priority customers.  When she is not saving the world from evil, she can be found hanging out with her 2 dogs in San Francisco, California. Lou can be found on Twitter as @LouisaHolland and on her personal blog http://civil3detcetera.blogspot.com/

Appears in these Categories

Back