Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Extract 3D Model tree with dwf toolkit

6 REPLIES 6
Reply
Message 1 of 7
SENL1267
1084 Views, 6 Replies

Extract 3D Model tree with dwf toolkit

Hi,

Is it possible to extract the 3D Model tree from a 3D dwf model by using the DWF Toolkit 7.5?
Can't find any samples on how to do this.

regards

Eddy
6 REPLIES 6
Message 2 of 7
janderssen
in reply to: SENL1267

Hi,

Look at examples of the HOOPS parsing :

samples/DWFToolkit/SimpleW3DStreamProcessor

This examples shows a few operations you can extract ( TKE_Shell, TKE_Comment, TKE_Text, etc) to get started.

The basic idea is create a handler for each different op code in the hoops scene graph, assign them as the handler, and process the stream. Your handler objects will get called in the order of processing the stream's opcodes.

Cheers
Jason
Message 3 of 7
w.forster.1
in reply to: janderssen

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?

Message 4 of 7
w.forster.1
in reply to: w.forster.1

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.

Message 5 of 7
w.forster.1
in reply to: w.forster.1

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.

Message 6 of 7
w.forster.1
in reply to: w.forster.1

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.

Message 7 of 7
w.forster.1
in reply to: w.forster.1

If anybody can get all the properties out of this file (without crashing) you win the prize!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services