Revit 2015 API News – DevDays Online Recording

As the Walrus said, now "the time has come ... to talk of many things", including the highlights of the new Revit API functionality, so here we go!

Welcome to my first post on the Revit 2015 API, disregarding the RevitLookup migration to Revit 2015, of course.

A couple of posts on upcoming Revit 2015 product functionality were already published in the past week or so, e.g.:

I will therefore skip all product related stuff and dive straight into the API instead.

Here is the Revit 2015 DevDays Online recording material, based on the presentations shown at the confidential Autodesk DevDays conferences in and around December 2013.

The next thing I want to do is to publish the "What's New" section from the updated Revit API help file RevitAPI.chm, to ensure it is available for and easily found by online searches, as for the past few releases:

That is always the first place to explore if you have any questions about or problems with your migration or the new functionality provided.

I wish you lots of fun and excitement exploring the new possibilities provided by the Revit 2015 API!

Right Click Circle of Commands GUI Design for Revit

Sticking with what we already have for the moment, another interesting this that just came up on the Revit API forum is this discussion thread initiated by Ryan on GUI design for Revit.

Ryan suggests developing a secondary user-infterface for Revit, like the right-click command in Fusion 360, or Inventor, a wheel (or circle) showing a pre-determined list of commands.

The Revit user interface could look something like this:

Revit user interface

Commands placed on circle segments:

Commands placed on circle segments

Interactive command population:

Interactive command population

Now Brett of BRevit presented a 20-second video of WheelConcept, a working implementation of a right-click circle of commands based on the PostCommand API.

In his own words:

I think a lot can be achieved with the postcommand function. Hope you don't mind but i took your idea and gave it a crack....

Firstly i created a form with the wheel as the background. I created a public property on the form which is the id of the command to issue:

  Public CommandToIssue As RevitCommandId

I then created transparent picture boxes over the various icons. Clicking on a picturebox asigns a command id and closes the form:

  Private Sub PictureBox2_Click( _
    ByVal sender As Object, _
    ByVal e As EventArgs) _
  Handles PictureBox2.Click
    CommandToIssue _
      = RevitCommandId.LookupPostableCommandId( _
  End Sub

Under the forms show event i added code to locate the form at the mouses current position:

  Private Sub WheelForm_Shown( _
    ByVal sender As Object, _
    ByVal e As EventArgs) _
  Handles Me.Shown
    Location = New System.Drawing.Point( _
      CInt(MousePosition.X - (Me.Width / 2)), _
      CInt(MousePosition.Y - (Me.Width / 2)))
  End Sub

Finally I setup a command to display the wheel, and post the command:

Option Strict On
Option Explicit On
Imports Autodesk.Revit.Attributes
Imports Autodesk.Revit.UI
Imports BrevitTools.UI.Wheel
<Transaction(TransactionMode.Manual)> _
Public Class Wheel
  Implements IExternalCommand
  Public Function Execute( _
    ByVal cmdData As ExternalCommandData, _
    ByRef message As String, _
    ByVal elements As Autodesk.Revit.DB.ElementSet) _
  As Result Implements IExternalCommand.Execute
    Dim form As New WheelForm
    If form.CommandToIssue IsNot Nothing Then
    End If
    Return Result.Succeeded
  End Function
End Class

To display the wheel inside Revit I assigned a shotcut key (ww).

Here is link to a video of it in action.

I think there is loads of potential for this. You could easily add code to check what elements are preselected and then display a contextual wheel.

Thank you very much, Brett, for sharing this!