Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Copy information from a specific parameter to a room

camlinFZG9Y
Explorer

Copy information from a specific parameter to a room

camlinFZG9Y
Explorer
Explorer

Hello All, 

 

First off, i am super new and super green to the Revit API and Programming. None the less, i am working on a script that i believe looks really good.

 

I am a BIM Manager for an Interior Design firm with about a decade of architectural experience and schooling. So its been an adjustment going from working in an architect office where i had full control over everything to being in an Interior Design firm working in Revit with only being able to control just my own elements. I have only been here 7 months and am tasked with clean up and standardization, so many of you can feel my pain.

 

That being said, The intent of the script, is to take a specific shared parameter with the name of "Floor M.C." (Which acts as a type mark parameter) that is associated with the floor category, copy the information from that family to the another shared parameter called "Floor" that is associated with the rooms. 

 

By this point you must be going ("WTF"). I'll explain. I am dealing with complexities from an existing model and a horrendous workflow, but i am doing the best i can to take what was once a very manual process due to the over utilization of "Generic Annotation" and streamlining things the best i can. 

 

I wrote this script, but keep getting an error from the pyrevit bundles creator environment saying that "ImportError: Cannot Import name RoomFilter. This is odd to me and i can't for the life of me resolve the issue to get the script to work. I have the latest Pyrevit and Ironpython builds

 

Please see attached images. Any help would be greatly appreciated!! Looking forward to your responses

0 Likes
Reply
208 Views
4 Replies
Replies (4)

ctm_mka
Advocate
Advocate

First, what version of Revit? Always helpful when asking for help, the answer can differ. For example, if you are 2025, the answer is RoomFilter does not inherit from Revit.DB, it comes form Revit.DB.Archictecture. RevitAPIDocs is your friend.

0 Likes

camlinFZG9Y
Explorer
Explorer

Revit 2022.1. 

 

I understand RevitAPIDocs is my friend, been scouring that website, through and through, but with being new to this, it's going to take me a minute to pick up on the nuances between versions However this is great knowld=edge moving forward as we use, 2023 and 2024.

0 Likes

ctm_mka
Advocate
Advocate

excellent. and it happens that RoomFilter is the same in 2022, so try adding an import line to your code for Revit.DB.Archictecture.

0 Likes

camlinFZG9Y
Explorer
Explorer

So i did as you suggested, i am still getting errors. 

camlinFZG9Y_0-1737072747455.png

 

I did notice that two words were greyed out. I hovered over top of them and got this message:

camlinFZG9Y_2-1737072889724.png

 

can you or someone please enlighten me on this? I did install pylance into my visual studio earlier today

 

0 Likes