Creating a parameter ribbon

Creating a parameter ribbon

a-carpentier
Advocate Advocate
669 Views
2 Replies
Message 1 of 3

Creating a parameter ribbon

a-carpentier
Advocate
Advocate

HI everybody,

 

I would like to know if there is a way to create a parameter ribbon (I circled in red what I'm talking about on the attached picture) using only the API.

 

The point would be to, when a macro is launched, let the users select different elements and then have them press an "ok" button located on the ribbon.

 

Thanks,

Antoine

0 Likes
Accepted solutions (1)
670 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Afaik, the Revit API does not provide any support for this.

 

You might be able to implement something similar yourself using the .NET Windows.Forms and other APIs.

 

Maybe you could even make use of the Revit dockable panel functionality for that is some way or another.

 

From your description, I would suggest implementing a .NET Windows.Forms modal form that is displayed at the beginning of your external command, enables the selection you describe, and is closed when the user hits OK, enabling the rest of the processing to proceed.

 

I hope this helps.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

a-carpentier
Advocate
Advocate

The dockable panel functionality seems a bit clunky, as it needs to be registered before opening a project which is a bit of a hassle, and moreover it is dockable but it doesn't seem to be initialized as docked (by that I mean  you have to dock it yourself if you want it to be docked after its initialization).

 

I can see it being useful for some specific tools or sets of tools, but it is way overkill for what I wanted to achieve.

 

I ended up displaying instructions using the StatusPrompt of the PickObject method and have the users press the escape key instead of pressing an OK button on a form, forgoing entirely the need for a form. It's not an ideal solution, but it will have to do for now.

 

Thanks!

0 Likes