I would like to open the Routing Preferences Dialogue UI on Revit for a specific duct type using Revit API.
The way I achieve this through the UI is
- Select a duct type from available families in the project
- Right-click and click on Type Properties...
- Click on Routing Preferences "Edit" under Fittings
- I get to the panel that I want (screenshot below)
The closest thing to what I want is this forum post: https://forums.autodesk.com/t5/revit-api-forum/trigger-quot-edit-type-quot-dialogue-box-from-api/td-...
However, even with this one, I failed to successfully open the Type Properties panel. I am able to select the duct type I'm interested in but the
RevitCommandId.LookupPostableCommandId(PostableCommand.TypeProperties) fails with the error Invalid postableCommand error message.
Below is the sample code I used
var collector = new FilteredElementCollector(doc);
var ductType = collector
.OfClass(typeof (DuctType))
.First();
uidoc.Selection.SetElementIds(new[] {ductType.Id});
var commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.TypeProperties);
uiapp.PostCommand(commandId);
However, even if this command works, my goal is to get to the Routing Preferences UI dialogue directly. Is there a way to do this?
Any help is much appreciated 🙂