DWF

Reply
Member
SENL1267
Posts: 3
Registered: ‎11-24-2008
Message 1 of 7 (524 Views)

Extract 3D Model tree with dwf toolkit

524 Views, 6 Replies
11-24-2008 08:22 AM
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
Contributor
janderssen
Posts: 19
Registered: ‎11-25-2008
Message 2 of 7 (524 Views)

Re: Extract 3D Model tree with dwf toolkit

11-25-2008 08:57 PM 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
Member
w.forster.1
Posts: 5
Registered: ‎12-17-2013
Message 3 of 7 (305 Views)

Re: Extract 3D Model tree with dwf toolkit

12-18-2013 11:30 PM 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?

Member
w.forster.1
Posts: 5
Registered: ‎12-17-2013
Message 4 of 7 (277 Views)

Re: Extract 3D Model tree with dwf toolkit

12-26-2013 08:52 PM 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.

Member
w.forster.1
Posts: 5
Registered: ‎12-17-2013
Message 5 of 7 (148 Views)

Re: Extract 3D Model tree with dwf toolkit

05-31-2014 01:36 AM 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.

Member
w.forster.1
Posts: 5
Registered: ‎12-17-2013
Message 6 of 7 (120 Views)

Re: Extract 3D Model tree with dwf toolkit

06-14-2014 02:15 AM 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.

Member
w.forster.1
Posts: 5
Registered: ‎12-17-2013
Message 7 of 7 (108 Views)

Re: Extract 3D Model tree with dwf toolkit

06-20-2014 03:30 AM in reply to: w.forster.1

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community