By Dennis Collin
Revit possesses some powerful scheduling and reporting tools, but one question that is often asked is can Revit families report what model group they belong to? Revit can get elements to report information like Room location, but not the model group they reside in, or at least not with the standard out of the box features. This feature is invaluable when working with House Type plans, Flats, Hotels and other similar projects such as healthcare. Despite not having the capability with the default tools, we can bridge the gap with Dynamo scripting, hurrah!
In the example above elements have been placed into two model groups, Deluxe Room and Standard Room. The requirement is to get certain categories, such as furniture, plumbing fixtures and other fittings to report what group they reside in along with a unique reference number. This information would then need to be extracted to a schedule.
For any bespoke schedule I recommend setting up some shared parameters. The parameter file needs two text-based parameters, ‘Group_Instance’ and ‘Room_Type’. The instance parameter will contain a unique ID reference, the room type parameter will contain the model group name which will be used in schedules.
These parameters can be added as project parameters to the relevant categories as Instanced with the values set to vary by group instance. We need this to be the case as group IDs will be unique to each group instance. Once assigned, selecting any element within a group will list some blank bespoke properties that can be scheduled or tagged (provided shared parameters are used).
Although we could input the data manually, that would be error prone and tedious, but by creating a Dynamo script a unique ID can be created and assigned to the relevant group members.
Within Dynamo a series of nodes are added, the first group of nodes gets all the unique group names and assigns them a unique number. The group name is combined with this unique number separated by a hyphen.
This ID reference is then set to each group and a further ID Room_Type property, which is based off the group instance property is then assigned to each group member. The Group Members node is supplied with the Clockwork Dynamo package. It should be noted that this clockwork note uses the older Iron python 2 code but could be easily converted to Python3. Even so, the script runs correctly, although Dynamo does flag a warning upon initial access, but this should be kept in mind with future versions of Revit and Dynamo and the possible removal of support for this legacy Python code environment.
After running the script, the selection of family members within each group now displays a properties palette with data, excellent! Since shared parameters were used, this information can be scheduled or tagged as required.
Komentarze (Komentarze: 0)