What type of element? And what do you mean by uploading the file in API? Can you describe what are you trying to achieve?
It is not as easy as it sounds. At first you need to know what can be done manually in the Revit UI. In most cases you will be able save it only as RVT (Revit project file).
System families and its types cannot be saved as RFA file.
Other loaded families can by default.
Do you mean Forge, BIM360, webGL or what type of web?
Geometry or information or both? Can you not use IFC?
Just getting wall and uploading it as RFA will not be possible, you can store it only in project.
Then you need to transform Revit element to some format that the web can show - e.g. webGL.
There is no native way through API.
I am sorry I do not understand your workflow, could you post some example?
And the objects are Revit elements? If so, my first reply stands.
You cannot save e.g. wall as RFA.
Then you need to get the family of the window and the you can save it to whatever path you want and then upload.
Element e;
FamilyInstance fi = e as FamilyInstance;
Family f = fi.Symbol.Family;
Document famDoc = doc.EditFamily(f);
famDoc.SaveAs("your path");
https://www.revitapidocs.com/2020/c605e437-5f18-81a5-d4ed-e664ba4f941d.htm
Hi @Anonymous ,
You have to provide the file name to save it as a .rfa file.
famDoc.SaveAs(@"C: \ Users \ victo \ Desktop \ project \ YourFileName.rfa");
I hope this helps.