Advertisement

Monday, April 30, 2012

More New Revit 2013 SDK Samples

An update to my previous post about the updated Revit 2013 SDK samples...

The Revit 2013 SDK has been updated since its initial release. If you are using the SDK, It is recommended that you immediately switch to the updated version.

The updated SDK includes three new samples:

DisableCommand

This sample is an external application, not a command, so you cannot test it by simply invoking it via RvtSamples. You have to copy its add-in manifest to the add-ins folder.

Once installed, it disables a command by replacing its implementation with a simple popup message. Specifically, it overrides the Design Options command, thus prevent users from accessing it. It performs the following steps:
  • A RevitCommandId is found to match the journal name of the command.
  • An AddInCommandBinding is created for this command id.
  • An alternate implementation is provided for the command binding.

To run it, once installed, simply start up Revit, open or create a project, and choose the Design Options button on the Manage tab. A popup explains that the command is disabled.

ScheduleCreation

This sample demonstrates how to create a wall category view schedule and display its data on a sheet. It performs the following steps:
  • Create an empty wall schedule.
  • Add some schedule fields by schedulable field.
  • Create new schedule filter.
  • Create schedule sorting/grouping field.
  • Display a sheet containing the wall schedule.

Run it as follows:
  1. Open Revit and create a new project based on the default Revit template.
  2. Manually create a couple of walls with different types.
  3. Run this command, for instance via RvtSamples > Views > ScheduleAPI.
  4. A view schedule of wall category and a sheet to show its data are created.

StairsAutomation

This is a slightly more complex sample that creates a series of stairs, stairs runs and stairs landings configurations based upon predefined hard-wired rules and parameters. It provides an example of how to create and populate stairs elements, e.g.
  • Use of StairsEditMode
  • Creation of standard stairs runs
  • Creation of sketched stairs runs
  • Creation of sketched landings

It also implements an extensible structure demonstrating how runs and landings creation can be combined into different stairs configurations.

To test this, start up Revit and open the 'Stairs automation.rvt' sample model. Execute the command, e.g. using RvtSamples > Elements > Stairs automation. Each time the command is run, a different predefined stair configuration is created:
  1. Single straight stair run
  2. Stairs/landing combination up to level 2
  3. Multi-span stairs/landing combination up to level 3
  4. Single curved stairs run
  5. Curve stairs run > 360 degrees 

Download the updated Revit 2013 SDK.

Credit: Jeremy Tammik's The Building Coder blog.

1 comment:

Robert Crawford said...

In Revit 2013 API a new class is added i.e. DataStorage, I know little b it of this but would be great if you can explain this in more detailed way with some examples.