How to read out families from an old model state

Maybe someone of you has some good thinking on this!

Is there a way to read and copy the families stored in the Revit model?

If these are loaded, up-to-date families from a folder structure, it is not problematic for me because in this case I know the save path and can get the family information (last modification date) via VBA-Makro and the families itself via Dynamo.

Now it can come to the case that we have separate model files for different planning phases / planning stages (we do not use the revit phase filters), which in turn contain families that have a different current status than those in the “current” family order.

The reason is, if we want to return to a planning variant / pre-study or want to export an old planning status - that the old status is fully preserved (model, families at that time).


In this context, it would also be important to know the last modification date of the families in the model.

If I want to read out the current status of families in a folder structure, I can do this via a VBA macro.
Since I do not know the path of the families, I tried to save these families via Dynamo in a folder.

However, this does not lead to the desired result, because the last modification date is modified to the current time, as soon as i save them to a new path. This was my approach:

I suppose it is not fully stable, because some exceptions got thrown (“family is not editable”, “Dependencies are not respected”).

With the families in the Revit model, the path is unknown to me. How are they integrated into the model or where are they located after they are loaded into the model?


Example:

Family was loaded into the model on 10.09.
However, family was revised in October.

I would now like to read out the family with modification date 10.09 from the model.


What approaches could I use here to get the modification date?

I am still lacking a bit of direction / approach as I am still unclear on how families are stored within the model.

Thanks for your time!

Sorry. I did read the above post fully… But see if that helps

Saving the family actually is no problem (although some exceptions got thrown).

I would need to get saving-path information and/or as well the last modification date.
Modification date gets overridden, as soon as i save the family.

I guess it´s necessary to access these data via python, but for this reason i need a better understanding how loaded families are stored inside a .rvt-model.

I do not believe that date of family modification is saved inside the model, so you’re going to have to spend a lot of compute to retroactively get at that data.

Periodic opening of the family document; querying of all types, associated parameters and values; comparison of that list of sublists against the control values (the last version saved); querying of all 3D geometry, pulling the vertices and serializing to string for each type; comparison of the vertices against the control value; querying of all two dimensional data, including detail items and line work; pull the sketch plane of each and serialize to a string; transform the 2D location data to the world coordinate system, and convert the geometry to vertices and into a string; compare the planes and vertices to the control… I am about 1/2 way there, and as you can see it is a BIG lift.

A better solution would be to track this data via other means. Two thoughts in that.

  1. An add-in could be authored to alter the behavior of the ‘load family’ commands, which would append a timestamped version of the file to a temp folder where the family document would be saved, and insert the path and time stamp value into the Revir file’s extensible storage. This is likely more robust, but would require that everyone have access to the paths, and the use of an add-in to modify Revit command behavior is a tall order.

  2. Revit journals record the ‘load family’ command quite readily. Collection and computationally parsing these will allow you to ID who brought in the family, when the family was brought in, and where it originated, both of which can be edited. To access a version of that family, open from the backups and/or restore to that point (which can be done nondestructively in BIM360 with 2022.1). This is far easier to build, but is slower. It also won’t work if you can’t consistently pull the journals from all users, but this can be done via your logon actions. The best part is that it will also gives you access to all the user data you could ever ask for - after all these are the literal recordings of ever action a user took in the application. once the parsing tool is written

Neither option will collect ‘in project’ changes such as making a new type, or changing type parameter values. There are just too many changes there to track readily.

1 Like

A big thank you for your very well elaborated answer Jacob!!

I have to take a closer look at it, to fully understand the details :slight_smile:

1 Like