Friday, March 30, 2012

New Revit 2013 SDK Samples

The Revit 2013 SDK includes new working samples that are related to the new add-in integration functionality, except for the RoutingPreferenceTools which demonstrate some of the MEP related enhancements.

ModelessForm_ExternalEvent and ModelessForm_IdlingEvent

Both of these display and show how to interact with a modeless form. One way to do this is to use the Idling event initially provided in Revit 2012, which we have discussed so much and in such depth in the past.

The ModelessForm_IdlingEvent sample should clarify many of the issues we dealt with.

The ModelessForm_ExternalEvent sample demonstrates an easier way to implement this interaction using the new external event interface.


The ProgressNotifier sample displays progress information for an action in a stack data structure for easier analysis. It demonstrates how to subscribe to the ProgressNotify related events, access properties in the event handler arguments, and organize the subtransaction progress information into a stack.


The RoutingPreferenceTools sample provides a number of MEP pipe routing preference tools.

This sample contains three commands, one for analysis and reporting purposes, two for importing and exporting routing preferences to XML:
  • Routing Preference Analysis: Analyze the routing preferences of a given pipe type to check for common problems, using the routing preferences API to look at all rules and criteria for a given PipeType.
  • Routing Preference Builder with its two commands CommandReadPreferences and CommandWritePreferences: Set pipe type, fitting, and routing preferences in a project from data in an XML file and export these preferences to XML for archival, documentation, and collaboration purposes, allowing a user to work with routing preference data in a shareable XML format suitable for reuse in a wide variety of BIM management environments.


The UIAPI sample demonstrates a number of the new add-in integration API features, including embedding a Revit view as WPF control inside its own dialogue, the new drag and drop API, and the Options dialogue support for custom extensions using arbitrary WPF components. This sample was also shown at the DevDays 2011 conferences.


The WorkThread sample demonstrates utilizing the Idling event in a multi-threaded application to communicate with the Revit API from an external work thread.

Credit: Jeremy Tammik's The Building Coder blog.

No comments: