Imported Object Styles

Imported Object Styles

Anonymous
Not applicable
1,451 Views
2 Replies
Message 1 of 3

Imported Object Styles

Anonymous
Not applicable

Hi,

Is there any possibilities to collect Object Styles (Imported Object Styles) details from Revit API?. 

Please refer attached image.

Thanks and Regards,

Vinoth Kumar

0 Likes
1,452 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

try using the below code

 FilteredElementCollector colle = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_ImportObjectStyles)

I hope this helps.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

Felix.Seguin
Explorer
Explorer

A little late to the party, but correct me if I'm wrong but the FilteredElementCollector only returns elements, not categories. So we would need to search in the categories instead:

Category cat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_ImportObjectStyles);
foreach (Category importObjectStyle in cat.SubCategories)
{
   ...
}

 

0 Likes