Hi Folks,
I have been working on a Revit Add-in. Users of this add-in use Revit 2015 and Revit 2016. This add-in displays a list of available Revit families and their symbols. Users can choose symbols of some family to load in Revit project. When user tries to load multiple symbols from the same family file that was created in some older version of Revit, they see a Model Upgrade dialog multiple times. This is because this dialog appears on each call to LoadFamilySymbol method.
Can we load multiple family symbols from the same family file in a single access to the family file? I don't see any overload of the method LoadFamilySymbol allowing to load multiple symbols.
There's an alternate to load complete family using LoadFamily but that will load some unnecessary symbols as well.
Any help?
Thanks,
Umar
Dear Umar,
The situation is exactly as you describe it:
You can load one single symbol at a time, or all at once.
Those are the two options you have.
For your situation, I would recommend maintaining two separate versions of the families for the different versions of Revit that you have in use, and implementing code to check for the existence, upgrade once only, and load the appropriate one to avoid the repetitive upgrade process,
I hope this helps.
Cheers,
Jeremy
Hi Jeremy,
Thanks for the reply.
As per your recommendation, I can load the document authored in some older version in newer version and save a copy of the upgraded document. But for this I would need to know the version of the authoring application of the family file.
So, is there a way in Revit API to check the version of the authoring Revit application before or after loading a family document?
Thanks,
Umar
Sure. Application.VersionNumber property:
http://www.revitapidocs.com/2017/320391bf-2c21-98ca-192c-da1d9becff11.htm
Hi,
you can open Familiy files by a text editor.
Doing so, you will notice an xml section, conataining some information about this Family.
I see an <updated> tag containing a date.
Using this, you could compare the update time without opening Family files in Revit.
Also, there is some access to the file info itself:
http://thebuildingcoder.typepad.com/blog/2010/06/open-revit-ole-storage.html
http://thebuildingcoder.typepad.com/blog/2013/01/basic-file-info-and-rvt-file-version.html
Revitalizer