- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm trying to get the XML data that is contained within a .rfa file, however I would like to do this without the 'ExtractPartAtomFromFamilyFile' method.
First of all, using the ExtractPartAtomFromFile method yields an error
Autodesk.Revit.Exceptions.InternalException: 'Failed to extract PartAtom from the family file.'
I followed the example found at: The Building Coder but without luck.
Secondly, I would like to manage these XML files from outside of Revit so not using Revit API is preferable, but acceptable if necessary.
Reading the binary file and trying to extract the XML part has not yielded any good results yet either.
My current code looks like this:
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
// Find revit family file
string folderPath = "C:\\Users\\mbny\\Desktop\\Revitudvikling";
string filename = "M_Upper Cabinet-Corner Unit-Wall.rfa";
string fullPath = folderPath + "\\" + filename;
Transaction trans = new Transaction(doc,
"Extract Part Atom");
trans.Start();
app.ExtractPartAtomFromFamilyFile(
fullPath, fullPath + "\\" + "createdXML.xml");
trans.Commit();
return Result.Succeeded;
Has anyone solved this successfully? I'm planning on doing this on a very large number of family files, and quite often as well.
Solved! Go to Solution.