Rooms Parameters

Rooms Parameters

Anonymous
Not applicable
448 Views
1 Reply
Message 1 of 2

Rooms Parameters

Anonymous
Not applicable

Hi,

I'm trying to get all rooms' parameters in a file without any room.

 

I tried the following code but I notice that I can get all families but rooms and areas:

FilteredElementCollector elementCol = new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol));

 

also

FilteredElementCollector elementCol = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Rooms);

this only works if I have at least one room in the file.

 

Anyone can help me?

0 Likes
Accepted solutions (1)
449 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

The easiest solution is to start a transaction, create a dummy room element, retrieve and save its parameters, and roll back the transaction without committing it. This is also know as the temporary transaction trick TTT. Here are many other examples of using it:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.53

 



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