The coming posts will look at the various new APIs in AutoCAD 2008. Here is the way I’ve decided to serialize the information:
- New ObjectARX samples - this post
- New .NET samples - the next post
- Other new APIs - the following post
So this post focuses on the new C++ samples on the ObjectARX SDK for AutoCAD 2008, talking about their corresponding features and APIs. Thanks to Stephen Preston, our DevTech Americas Manager and the presenter you may seen in the previous post, for providing the bulk of this information.
One of the most highly anticipated new features in AutoCAD 2008 is annotation scaling. This new feature addresses the problem of getting annotation elements to display at the same ‘paper size’, regardless of the scale of the viewport they are displayed in. In the past, users would normally address this problem by adding multiple versions of the same annotations on different layers, and turning those layers on or off depending on the viewport scale. This new feature avoids all that by allowing the user to simply specify the display size of each annotation object for each viewport layer it displays in.
The sample demonstrates how your application and any custom entities it defines can work seamlessly with the annotation scaling feature. Annotation scaling works through Protocol Extensions, but (unlike most protocol extensions) it does require code to be added to your custom entity.
The sample shows how to derive a custom entity from a standard annotative entity and add additional annotative features to it. The standard annotative entities are:
For those of you not interested in custom entities, the sample also demonstrates how to query and manipulate the annotation scales and entities in a drawing.
AcDbTable and its associated classes have been greatly enhanced in this release. They are well worth a look – of particular interest is the increased capacity to link between AutoCAD Tables and Excel worksheets.
We’ve added additional commands to the existing ObjectARX sample to demonstrate:
- Creating a data link between a table and an Excel worksheet.
- Breaking a table (and then restoring it afterwards)
- Creating a template from an existing table that can then easily be used to set the same style for other tables.
- Adding multiple content to a single table cell – a mix of blocks and text, for example.
The Table API also includes other formatting enhancements to more fully control the style of the table. These include cell styles, auto-fill, cell tooltips, cell locking, and formulae.
A section plane allows you to display a section, or slice, through three dimensional geometry in your drawing. The feature was introduced in AutoCAD 2007, and we included a very simple demonstration of the API in the ObjectARX 2007 SDK Surface_Helix sample. To better demonstrate this feature, we’ve now enhanced the functionality and broken it out into its own sample.
The new sample allows you to define a section plane in your drawing and then walk the section through your geometry, recording snapshots of the section as you go. The snapshots are recorded as block table records. Other commands demonstrate querying section properties.
AutoCAD 2008 has filled in a few of the missing pieces from the 3D-oriented AutoCAD 2007 release. One area we’ve enhanced is the use of materials inside AutoCAD. Our aim is to provide all the functionality in AutoCAD that previously required the VIZ Render application.
The existing material sample has been extended to demonstrate the use of the new procedural material types – speckle, wave, checker and tile. The sample also expands previous commands to show how to assign materials and landscape materials to a custom entity.
Another enhancement to the AutoCAD visualization functionality in this release is enhanced lighting. (What’s the use of all these new materials styles if you can’t light them properly? :-)
This release sees the introduction of parametric lighting, including support for the Illuminating Engineering Society (IES) ‘web’ file format.
Other features include: enhanced sun and skylight properties; tone operator support for high dynamic range lighting in scenes; and a new look 3D sky background for the interactive viewport;
The Render sample has been extended to demonstrate the use of these new lighting and shadow effects.
Note on VSPROPS:
All our ObjectARX samples have now been updated to make use of common "project property sheet" (VSPROPS) files. These files store common Visual Studio (C++) project properties, which clearly help reduce the effort required to maintain these settings in each of our various samples, as well as demonstrating how to use this useful Visual Studio feature. The relative paths to these property files are hardcoded in the sample project settings, so you’ll need to edit them if you copy a sample to a different location. These VSPROPS files (rxsdk_common.vsprops, rxsdk_debugcfg.vsprops, rxsdk_releasecfg.vsprops) are stored in the ObjectARX SDK inc folders.