Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Upgrade Box Appears Multiple Times

4 REPLIES 4
Reply
Message 1 of 5
muaslam
290 Views, 4 Replies

Upgrade Box Appears Multiple Times

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

4 REPLIES 4
Message 2 of 5
jeremytammik
in reply to: muaslam

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5
muaslam
in reply to: jeremytammik

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

Message 4 of 5
jeremytammik
in reply to: muaslam

Sure. Application.VersionNumber property:

 

http://www.revitapidocs.com/2017/320391bf-2c21-98ca-192c-da1d9becff11.htm



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 5
Revitalizer
in reply to: muaslam

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




Rudolf Honke
Software Developer
Mensch und Maschine





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community