In the last post we looked at the new ObjectARX samples for AutoCAD 2008, while today we're looking at the .NET samples. In the next post we'll look at the other new APIs available with AutoCAD 2008.
With the exception of custom objects, .NET now includes essentially all the functionality available in ObjectARX. While the ObjectARX samples are a good reference for .NET programmers, we’ve also bolstered our collection of .NET samples.
Unfortunately, we were unable to add full .NET documentation for this release, but rest assured that our Technical Publications team is working hard on it. In the meantime, please do let me know of your interim documentation requirements, and we’ll try to post something via this blog.
CUISamp
A little know fact is that the .NET CUI API does not actually depend on AutoCAD, so it can be accessed when AutoCAD itself isn’t running. This means you can use it directly from your installer. We’ve reworked the CUISamp sample to better demonstrate how your application can add its own CUI entries at install time and remove them again during uninstallation.
The CUISamp sample itself remains an AutoCAD add-in, but demonstrates these concepts through the following added functionality:
- Run once configuration – The CUI is updated the first time your application loads into AutoCAD. Subsequent loads will leave the CUI untouched.
- Forced CUI state – Removes and rebuilds the workspace to a default setting.
- Removal – Removes all the CUI elements added by the sample, as you would do during uninstallation.
The CUI API also includes new support for the AutoCAD ‘dashboard’ – a feature not demonstrated in the sample. Check out the ‘Customization’ namespace in our .NET API for details of those classes.
Managed_SurfaceHelix and ManagedRender
Managed_SurfaceHelix is a direct port of the ObjectARX Surface_Helix sample to .NET, and ManagedRender does the same for the Render sample.
Note: The ObjectARX Render sample has been enhanced this year. Those enhancements are not yet reflected in the managed sample.
SimpleSquare
SimpleSquare is actually both an an ObjectARX and a .NET sample, in that it demonstrates how to expose a simple ObjectARX custom entity to .NET through a managed C++ wrapper. This is clearly of great interest of developers who wish to use .NET wherever possible, but still require the use of custom objects in their application.
We also demonstrate how to generate .NET events from the custom entity, and how to consume them in a managed .NET application; and how to jig the entity from .NET.
Those of you who are interested in this topic and have access to the ADN site will find this whitepaper on Managed Wrappers to be helpful.