I am still having trouble with this - I can read shells out of a dwf file, and I understand that getting the selection tree will have to do with TK_Open_Segment and TK_Close_Segment, but I am stuck there.
Somewhere in the stream there has to be the string that names the different segments and I can't find it. Eg. in the 3Dpublish sample,
//
// open with a name, this will show in the nav tree
//
oPart1.open( L"First Part" );
What handler will "First Part" show up in?
I have made some progress, I have found the handler TK_Referenced_Segment handles opcode TKE_Include_Segment which is important for the selection tree.
I also found that if you change the .dwf file to .zip, there are some xml files which designate the names of different segments/selection tree items.Navisworks can still read the names without these xml files though. Help still needed if possible.
I have made yet more progress!
In the TKE_Open_Segment handler a call to this->GetSegment returns the 'object' number.
The sample objectdefinitionreader shows how to get the properties associated with objects including the name which shows up on the nav tree.
The only problem is it is so slow! How do you speed this up? I know it's possible because Design Review can open the files much quicker than objectdefinitionreader can process the exact same files.
Ok so it seems for large files that objectdefinitionreader is hanging. I just assumed it was taking a long time.
Still no solution in sight to get the nav tree names for big files.
If anybody can get all the properties out of this file (without crashing) you win the prize!