Monday, April 29, 2013

Migrating .Net Apps to AutoCAD 2013

As I began migrating my .Net apps developed in Visual Studio 2010/AutoCAD 2011 to AutoCAD 2013, I quickly realized a new .dll reference is required. After updating the project references with the 2013 versions of acdbmgd.dll and acmgd.dll then re-building the solution I was presented with the following error message:
The type or namespace name could not be found
 
The additional .dll that is required is the accoremgd.dll (located in the root AutoCAD 2013 install location). Add this reference and I assume continue to set copy local to False (same as acdbmgd and acmgd). Also, make sure to set the Target Framework to .NET 4 (should be the default) and you should now be ready to be programming on the AutoCAD 2013 platform.
 
 
 
 


Friday, April 26, 2013

The AutoCAD custom.cui is a perfect place for custom content

Even in a managed network environment where custom CAD content is maintained and deployed, it is still nice for individual users to have the ability to add their own customizations. An administrator can maintain control of an environment but it can be good to encourage creativity for users. This gives them a chance to explore the AutoCAD CUI environment, make custom CUI elements (ribbon tabs, panels, menus, etc.) and develop useful (or just fun) macros and custom commands. The perfect place for all of this to happen is the custom.cui that is delivered with AutoCAD and resides on the local C:\ drive.

The delivered acad.cui file already has the custom.cui partially loaded. This means that every time the acad.cui file is loaded it will load the partial custom.cui file.


The custom.cui is located in the same appdata\roaming\autodesk\....\support folder that the acad.cui is. There is not a custom.mnl by default, but as we have discussed in earlier posts AutoCAD will look for a .mnl file that has the same name as all loaded CUI files. This means if we create a custom.mnl file and store it in the above location, our individual custom content in the .mnl will be automatically loaded every time AutoCAD loads! Note, one of the most helpful uses of an .mnl file is it can be an access point to load other lisp files, dll files, arx files, and more.

Using the custom.cui is a streamlined way for individual users to add creative and custom user interface elements, commands, and macros to their environment and still keep it separate from the acad.cui and network delivered content. Furthermore, this makes upgrading simple for individual users since they will just need to grab their custom.cui (and .mnl if one was created) and introduce it in the next version of AutoCAD (some tweaking may be necessary depending on differences in CUI handling from version to version).

To get started, launch AutoCAD and browse to the custom.cui as shown above. Refer to this earlier post as a refresher on how to create a custom ribbon element.