« Delux Database Enabled Loading and Updating | Main | Duplicate Built-in Parameter Values and BipChecker Update »

January 24, 2013

Comments

Hi, Jeremy.
Thanks for posting.
Some remarks.
To get access to the StreamInfo class you need reference WindowsBase.dll assembly.

At the result console you see many question symbols because one part of BasicFileInfo encoded in Unicode and another part encoded in BigEndianUnicode (sorry, I could find the link quickly:)).
You can see another part of BasicFileInfo by following code
var rawString = System.Text.Encoding.BigEndianUnicode.GetString(rawData);

Have a nice day,
Victor.

Dear Victor,

Thank you for the update and important additional info.

How do I know which part is which? Is it determined by length, or what?

I would like to add the big-endian decoding to my sample code right away.

Thank you!

Cheers, Jeremy.

Hi Jeremy, hi Victor,

think of a RVT file that was saved by a Revit 2013.
If a plug-in (which runs inside an old Revit 2012) tries to open the file, it will fail.

Revit files cannot be opened by older Revits.

Your approach can help to avoid that situation.

May be relevant when developing multi-version apps.


Cheers,
Rudolf

Hi Jeremy, could you please take a look at my problem here:
http://thebuildingcoder.typepad.com/blog/2008/09/selecting-all-w.html
or here: http://stackoverflow.com/questions/14502890/getting-wall-brutto-area-in-revit-api
What could be wrong there? Is there any other way to get the wall area brutto?

Cheers,
Mike

Hi, Jeremy.
Actually, I didn't know which part is which.
But I've made a little investigation of BasicFileInfo structure. It seems I was wrong with BigEndianUnicode

As I understand BasicFileInfo stream is the binary format of some structure. I tried to understand with this structure and came to the following conclusion.

1. First 4 bytes - unknown Int32 value
2. Next 4 bytes - unknown Int32 value
3. Next 2 bytes - unknown Int16 value
4. Next 4 bytes - Int32 value is the length of following string representing local path of the file
5. Local path of the file in Unicode
6. Next 4 bytes - Int32 value is the length of following string representing Revit version
7. Revit Version as Unicode string
8. Next 4 bytes - Int32 value is the length of following string representing path of the central file
9. PAth of the central file
10. Next 5 bytes - Unknown for me (or Int32 + 1 byte)
11. Next 4 bytes - Int32 value is the length of following string representing path of the central model identity
12. the central model identity
13. Next 4 bytes - Int32 value is the length of following string representing path of the locale when saved
14. String. Locale when save
15. next 2 bytes - 0d 0a is \r\n
16. All remaining bytes without two last bytes - Unicode string which represent all previous info as whole string.
17. The last two bytes - 0d 0a is \r\n

I wrote a simple code to extract the data. It is just a sample :). Updated code

It is for 2013 Revit file. As I can suggest, In the revit 2012 file there is no string which represents all information (step 15-17).

The unknown values perhaps represent IsCentral, IsCreatedLocal, IsInProgress, IsLocal, IsWorkshared, Open workset default, project spark file properties.

I think I cannot say you more information.

Regards,
Victor


Jeremy,
What is the purpose of the various properties in the BasicFileInfo class such as "Username" and "IsWorkshared" if you don't use them in the code? I tried to use the class similarly to the TransmissionData class but get an error. Thanks.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource