Stair Support Parameter Binding

Stair Support Parameter Binding

csds360
Contributor Contributor
1,232 Views
5 Replies
Message 1 of 6

Stair Support Parameter Binding

csds360
Contributor
Contributor

Hi

I wanted to see if anybody could shed some light on this.

I have been having a problem with parameter binding to a particular category through the API. This is the 'Support' category that is a child of 'Stairs'.

 

Through the UI, this simply is done by checking this box:

csds360_0-1597249425861.jpeg

 

When you get the category from the element in Revit via RevitLookup it returns:

Category of BuiltInCategory.OST_StairsStringerCarriage with .AllowsBoundParameters = True

 

 csds360_1-1597249515676.jpeg

 

When you get the category via

Category.GetCategory(Doc, BuiltInCategory.OST_StairsStringerCarriage) it returns:

Category of BuiltInCategory.OST_StairsSupports with .AllowBoundParameters = False

 

This is preventing attaching parameters to the element via the API (as can be done in the UI).

 

Does anybody know if there is a way round this, or is this in the API by design or possibly a bug? 

 

Any help would be greatly appreciated?

Many thanks.

 

@Anonymous @naveen.kumar.t@RPTHOMAS108 

0 Likes
Accepted solutions (1)
1,233 Views
5 Replies
Replies (5)
Message 2 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @csds360 ,

 

The development team is aware of this issue and they are working on it.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 6

csds360
Contributor
Contributor

Hi @naveen.kumar.t 

Many thanks for your prompt response and clarification. 

0 Likes
Message 4 of 6

dev
Contributor
Contributor

Just a remark - I am also encountering this issue for my company's Revit plug-in.

0 Likes
Message 5 of 6

aignatovich
Advisor
Advisor
Accepted solution

Hi guys. Yes, I understand this is an old post, but this issue also affects the latest Revit 2022 version.

 

So the workaround could be something like this:

var col = FilteredElementCollector(doc);

var filter = new LogicalAndFilter(new ElementCategoryFilter(BuiltInCategory.OST_StairsStringerCarriage), new ElementIsElementTypeFilter());

var element = col.WherePasses(filter).FirstElement(); // At least one type exists even in empty model. Revit prevents deletion of the last element type of this category

var category = element.Category; // correct OST_StairsStringerCarriage category
Message 6 of 6

csds360
Contributor
Contributor

Thank you @aignatovich. That did the trick.

0 Likes