I need to put windows area on room tag. Is it possible to display parameters on tags of different family with Pyrevit?
HiHelloWelcome,
To answer your question: Yes
As long as you can relate the windows to the rooms, that should not be an issue:
- Collect the windows
- Group per room: Detect in which room is each window
- Sum the areas per room
- collect the rooms
- write the sums in a builtin(‘Comments’ for example) or shared parameter of the room
- use this parameter as a label in your room tag
To ease the programming, make sure you have the right parts in the window and room. I presume this is to calculate glass area, so make sure you have the “Glass Area” parameters in your window so you don’t have to programmatically calculate that with pyRevit. Always do as much with Revit as possible first. Your code will be simpler and run faster.
Your windows should also have room calculation points turned on. Again, this make collecting the windows in each room simpler.
Ideally, this would eventually be an event hook (save, print, open, etc) or ideally as a Updater in your startup script. But start with just a simple app first. This would make the whole process touchless - it would just happen with no user intervention.
But if you are new to pyRevit, start with a simple app. Then you can modify it into a hook-based script and eventually a Updater once you have the hang of things. (This is actually a very good use of an Updater as it has low overhead. I use several similar Updaters in our office.)
At the moment I have obtained what I need, the ratio between the surface of the room and the glass area of the windows, but only through schedule. My goal is to insert this data on the room tag.
I have only recently discovered Pyrevit so I do not understand what you are talking about especially if you are talking about apps. Could you suggest me where to find information about it?
App. Script. Same thing.
You’re in the right place. Everything is here for you to get started.
Read the docs. Write some code.
https://pyrevitlabs.notion.site/Create-Your-First-Command-2509b43e28bd498fba937f5c1be7f485