Atom XML file from Revit PROJECT file (not family PartAtom XML)

Atom XML file from Revit PROJECT file (not family PartAtom XML)

EATREVITPOOPCAD
Collaborator Collaborator
821 Views
2 Replies
Message 1 of 3

Atom XML file from Revit PROJECT file (not family PartAtom XML)

EATREVITPOOPCAD
Collaborator
Collaborator

I am playing around using 7 zip and exploring the .rvt compound file structure. I came across something strange.

 

With 7-zip you can extract a .rvt file as a compound file, and it works on all Revit projects I tried.

 

In 7-zip, I decided to play with different settings and found out that if you extract a .RVT file as a ZIP archive, it gives warnings, and doesn't extract any data that you would see when exploring the compound file structure, but instead you get a really cool XML Atom file with some good information in it... Has project owner, project address, project number, Revit version, etc... PROBLEM: this works on like 80 percent of Revit projects I tested it on. On certain projects, it just errors out and no XML Atom file is extracted... I tried finding the common denominator, and I believe it fails on projects that have imported AutoCAD DWGs, but this is just a theory...

 

My question: Does anyone know a proper way of getting the XML Atom file out of .RVT compound file structure? My zip method seems like a glitch, and I do not have enough knowledge of all of the moving pieces to know where to research this.

 

I found information on family PartAtom XML files, but not on Revit project files...

 

Here is the XML file i get out of .RVT if I extract it as a ZIP file:

 

<?xml version="1.0" encoding="UTF-8"?>

-<entry xmlns:A="urn:schemas-autodesk-com:partatom" xmlns="http://www.w3.org/2005/Atom">

<title>REVIT_2022_PROJECT</title>

<updated>2022-07-06T09:53:41Z</updated>


-<A:taxonomy>

<term>adsk:revit</term>

<label>Autodesk Revit</label>

</A:taxonomy>


-<A:taxonomy>

<term>adsk:revit:grouping</term>

<label>Autodesk Revit Grouping</label>

</A:taxonomy>


-<link href="." type="application/rvt" rel="design-2d">


-<A:design-file>

<A:title>REVIT_2022_PROJECT.rvt</A:title>

<A:product>Revit</A:product>

<A:product-version>2022</A:product-version>

<A:updated>2022-07-06T09:53:41Z</A:updated>

</A:design-file>

</link>


-<A:features>


-<A:feature>

<A:title>Project Information</A:title>


-<A:group>

<A:title>Identity Data</A:title>

</A:group>


-<A:group>

<A:title>Route Analysis</A:title>

</A:group>


-<A:group>

<A:title>Other</A:title>

<Project_Issue_Date type="system" typeOfParameter="Text" displayName="Project Issue Date">Issue Date</Project_Issue_Date>

<Project_Status type="system" typeOfParameter="Text" displayName="Project Status">Project Status</Project_Status>

<Client_Name type="system" typeOfParameter="Text" displayName="Client Name">Owner</Client_Name>

<Project_Address type="system" typeOfParameter="Multiline Text" displayName="Project Address">Enter address here</Project_Address>

<Project_Name type="system" typeOfParameter="Text" displayName="Project Name">Project Name</Project_Name>

<Project_Number type="system" typeOfParameter="Text" displayName="Project Number">Project Number</Project_Number>

</A:group>

</A:feature>

</A:features>

</entry>

 

 

 

 

 

 

The definition of insanity is doing the same thing over and over again and expecting different results
0 Likes
Accepted solutions (1)
822 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor
Accepted solution

Apart from the API function you can also extract the atom directly from the file. There have been many discussions on it so it is hard to find the right link but the below works to the extent noted and is much quicker than the API calls. You can open the file directly in notepad and see that the atom is there to be read along with the basic file info / transmission data.

 

Regarding 7-Zip I've not encountered any issues using that previously. 7-Zip supports the old OLE strcutured storage and would assume the Revit files all use the same form of that. However there may be nested streams so 7-Zip would only initially extract the top level items I've found.

 

The Building Coder: Standalone BasicFileInfo and ExtractPartAtom (typepad.com)

 

The above is noted as not working for work shared files, can only guess why although opening the file in notepad would probably provide answers. Perhaps it's the case that this information is not centralised for work shared i.e. does it appear in the user local or backup folder instead (not sure). 

 

The other advantage of the API part atom method over the above would be that the type catalogue information is included. The Atom within the rfa only contains the types defined in the family file so the API method also reads the type catalogue. So if extracting type information your would have to read the type catalogue file separately to replicate what the API method does.

 

The annoying thing about part atoms is that they are localised. So if you read one to find out what category a family file is then you need to account for all the localised variations of that category name. Note that the part atom is localised by the UI culture of Revit and not carried over from the localised template. That is to say if you created a new structural framing family from the English template in a French  UI version of Revit then the part atom will list the category as: "Ossature".  I categorise this as the problems we didn't know were problems in the English Revit world.

 

 

Message 3 of 3

EATREVITPOOPCAD
Collaborator
Collaborator

Thank you for in-depth explaining this! I was looking toward getting the project information & address outside of the API, but the work-shared model thing is a bummer. Luckily for what I am doing now, I will be ok with just using the BasicFileInfo contents... I can see how it is useful for families though.

The definition of insanity is doing the same thing over and over again and expecting different results
0 Likes