Thursday, February 13, 2014

Setting up AutoCAD with common support files while allowing some customization

This is going to be another dense post, intended mostly to remind myself of how everything is set up, but posted also to help people already familiar with the way AutoCAD is deployed and customized. Please make sure you know how to work with cuix files and load them via the customization file portion of the options dialog before proceeding.

Our firm recently rolled out AutoCAD (and BDS) 2014 to our users. For the past few releases (since 2008, I believe) I've been very interested in using common support files stored on the network, but have always had to come back from the edge because of one or two limitations such a setup would impose: the inability for users to have their own .pgp file (command alias list) has always been a big one among these.

This time however, I believe I finally have figured out the "right" way to do this stuff, and I wanted to document it here while it's still fresh.

First of all, the benefits of sharing support files. It has happened in the past that, for instance, I create a new line type for a job, which ends up being very useful and I want to make a part of our library for everyone. Or a new hatch pattern. Or change some buttons on our custom ribbon tab, etc. I used to have to make the change to my own support files, then copy them into the deployment folder (for any future re/installs), then send out an e-mail to everyone with the location of the updated files and ask them to manually copy the new files into two locations on their local machines. Both of these locations were within (different) hidden directories, and so depending on the machine, had to be manually typed in, and one of the locations was a path that's about 18 miles long. That was the only way of ensuring that they had the new files, both now in the future when an inevitable new Windows profiles might be created and set up using AutoCAD's userdatacache.

Obviously this is a painful and annoying process, for everyone.

The promise of shared support files, on the other hand, is that I (as an administrator, not a typical user) can make a change, once, and upon the next launch of AutoCAD, everyone's files are automatically up-to-date since all our installations are literally using the same files. Obviously in the case of laptops (which will be asked to run AutoCAD away from network connectivity) we have to make use of offline files (and for the love of cheese, do this via Windows Policy using Administratively Assigned Offline Files), but we've already been doing that, so that literally took no additional effort in our case.

But AutoCAD's deployment routines aren't so fine-grained that I can specify that acad.cuix, our enterprise cuix, hatch file and linetype files should be shared, but that (for instance) the .pgp file shouldn't be. And even if it were, it's a pain for the users to have to navigate through 18 layers of folders to get at their .pgp file if they want to change or add a command alias.

The first discovery (I would link to a forum post if I remembered what it was, but it was a rather oblique reference to this process anyway) is that AutoCAD has a list of support file paths, and it treats the list as a hierarchy, going down the list until it finds the file it's looking for, at which point it stops looking for it. So even though our shared support file path does include a single acad.pgp file, nobody's machine is actually using it. Why? Because as part of the AutoCAD installation, I told it to create a new folder at c:\acadsupport and stick another acad.pgp file in there. Then I put c:\acadsupport at the top of the list of Support File paths. Any files in acadsupport are now available to AutoCAD (and functionally override whatever identically-named files may be in the shared support file directory on the network).

That seemed like the end of it ... until someone asked how to customize their Quick Access Toolbar. Ouch. You see, I'd created a "default" Quick Access toolbar in our enterprise cuix file and added it to the workspace I'd created in the same enterprise cuix file for everyone to use. (This workspace has our custom ribbon tab, for instance). And the problem is that everything in the enterprise cuix is read-only (presumably so that one person can't change everyone else's workspace in the event that the main customization file isn't shared). So the Quick Access toolbar was forced to be identical and unchangeable for everyone...which is contrary to the way most people are used to using those toolbars (for instance, in Office).

The solution ended up being creating an additional cuix file that contains nothing but a Quick Access Toolbar. I used the transfer tab of the CUI window to copy the Quick Access Toolbar into a new file, and saved the resulting cuix file as quickaccess.cuix. That way it is set up with some default buttons for convenience. Then I included it as part of the AutoCAD deployment to get installed to c:\acadsupport.

Since I'd already included a quick access toolbar in our enterprise customization file, I first had to edit the workspace definition so that it didn't include any quick access toolbar. If you don't find yourself in the same situation as I did, skip this paragraph. (By the way, the easiest way I found to edit the enterprise cuix file is to set it as your main customization file and set acad.cuix as the enterprise customization file temporarily). In the left side of the CUI window, expand your enterprise customization file and under Workspaces, highlight your workspace. Now in the right side of the window, right-click the quick access toolbar and choose "Remove from workspace". Then click the "Customize Workspace" above the right side panel, and uncheck the box next to the quick access toolbar on the left side of your custom CUI file under "Quick Access Toolbars". Now exit customize workspace mode, and right-click the quick access toolbar on the left side of the window and choose to delete it from your cuix file entirely.

Now you're ready to link in a personalizable quick access toolbar. Make sure acad.cuix is set to your main customization file. In the CUI window, at the bottom of the main customization file tree, there's an entry labeled "Partial Customization Files". Right-click this item and load c:\acadsupport\quickaccess.cuix. Since everyone is sharing this acad.cuix, all their installations will now look for this file. (if it doesn't exist, it won't pop up an error or anything, it will just note that it's unresolved).

Now you need to update the workspace stored in your enterprise file to include the quick access toolbar stored within this partial cui file. Set your enterprise cuix file as your main customization file (swapping acad.cuix over to the enterprise customization file node at the same time so it's still available), then get back into the CUI dialog. Find and select the workspace you want this quick access toolbar to show up in, then on the right panel click the "Customize Workspace" button. On the left panel, scroll down to the partial cui file, expand it to the quick access toolbar item, and check the box next to the default quick access toolbar you made. It should show up on the right panel now under Quick Access Toolbar. Exit customize workspace mode. Now put acad.cuix back as the main customization file, and your enterprise cuix file as the enterprise customization file again.

One final step: to make sure the settings get saved, set your current workspace to your enterprise workspace again.

Now each user should be able to freely customize their own quick access toolbar however they want...their personal toolbar is saved in c:\acadsupport\quickaccess.cuix (you should see the timestamp on that file update whenever they add or remove a button). The shared acad.cuix file is set to look for that file, and the toolbar contained therein is used by the workspace saved in the enterprise cuix file. (By the way, you can't load quickaccess.cuix as a partial customization file under your enterprise file, because remember that it and anything it loads is marked read-only).

*whew*

Of course, you could simply store the workspace and any of your enterprise customizations in the shared acad.cuix, but (although I don't know the actual reason it's set up this way) it does seem prudent to keep your customizations in a separate file from all of AutoCAD's defaults - especially since that file is set to read-only by all your users. acad.cuix is easy enough to restore to default, but your own customizations might get goofed up beyond help if your users discovered they had the power to get in and tweak things.


The final result: here's how my CUI window looks. The Quick Access toolbar is stored in a cuix file in each user's local c:\acadsupport directory (and thus customizable and personal), which is loaded by the shared acad.cuix and used in the workspace stored in the shared enterprise customization file.

Labels: ,