Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Opening Routing Preferences of Duct Types via Revit API

0 REPLIES 0
Reply
Message 1 of 1
aryan4WGLU
138 Views, 0 Replies

Opening Routing Preferences of Duct Types via Revit API

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 

  1. Select a duct type from available families in the project
  2. Right-click and click on Type Properties...
  3. Click on Routing Preferences "Edit" under Fittings
  4. I get to the panel that I want (screenshot below)

aryan4WGLU_0-1696998141916.png

 

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 🙂

Labels (4)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report