Posts: 20
Registered: ‎08-04-2006
Message 1 of 7 (790 Views)

Retrieving Object Names

790 Views, 6 Replies
12-13-2006 11:23 AM
Hi all,

Following the code in ObjectDefinitionReader I managed to read object names but as it turns out I'm having a very hard time finding a way to actually map those names to the objects, i.e. finding what name belongs to what object. I read somewhere in the forum where Grarrick had pointed out that the key lies in TKE_Tag opcodes and these tags can be used for such later mappings, but I can't figure out how to use these tags. I was wondering if he or anyone else can point me the right direction and maybe some implementation details. Any helps would be greatly appreciated.
Valued Contributor
Posts: 55
Registered: ‎12-01-2005
Message 2 of 7 (790 Views)

Re: Retrieving Object Names

12-13-2006 02:55 PM in reply to: TheUnknown
Hi TheUnknown,

What I do is as follows:
The DWFDefinedObjectInstance->name() corresponds to the hoops TKE_Open_Segment Handler "GetSegment"

Basically I create a map of DWFDefinedObjectInstance->name() to all the properties, and as I process the Hoops Scene Graph, in eash OpenSegment::Execute function, lookup the map with the value returned by GetSegment();

If you want the 2d Whip location for the mapping, set a action event for set_object_node_action, and in the first parameter of the callback is WT_Object_Node, which has a object_node_name(), and voila, this corresponds back to the map I created.

Now regarding the hoops scenegraph, some contain libraries at the front of the scenegraph, and you will have to not assign details to these, but later on, transpose them to the correct location, and then assign the properties. ie "?Include Library" indicates the start of the include library. See the hoops documentation for more details regarding this. I just thought I would warn you on some of the pitfuls I hit as trying to figure all this out.

I Hope this helps.

Posts: 20
Registered: ‎08-04-2006
Message 3 of 7 (790 Views)

Re: Retrieving Object Names

12-13-2006 11:43 PM in reply to: TheUnknown
Thank you very much for the reply Jason .

The include libraries are exactly another problem I'm currently facing. I thought I would construct a map of segment names (acquired via GetSegment()) and object properties in the TKE_Open_Segment handler and then in each pass of TKE_Include_Segment search that map and find the pair that this TKE_Include_Segment references, and then copy the properties into it, but as it turns out, this doesn't work correctly. Maybe I should review some parts.

I try to implement your method names.

Thanks again.
Posts: 20
Registered: ‎08-04-2006
Message 4 of 7 (790 Views)

Re: Retrieving Object Names

12-14-2006 05:19 AM in reply to: TheUnknown
By the way, does anybody know under what circumstances 3DS Max or other modeling packages that support DWF generate TKE_Include_Segment opcodes. I thought maybe if I know the situations in which this opcode is generated, maybe I can totally avoid them.

Thanks in advance.
Valued Contributor
Posts: 55
Registered: ‎12-01-2005
Message 5 of 7 (790 Views)

Re: Retrieving Object Names

12-14-2006 02:01 PM in reply to: TheUnknown
I have some autodesk inventor published dwfs that contain TKE_Include_Segments. So I guess if you can get access to inventor, and publish to dwf 3d, you should be able to create dwf's that contain this opcode.

Jason Anderssen
Active Member
Posts: 10
Registered: ‎06-17-2010
Message 6 of 7 (787 Views)

Re: Retrieving Object Names

07-13-2010 10:39 AM in reply to: jasona

HI all,


I have tried to followed same procidure but i am not able to get DWFObjectDefiantion any component (except one given in ObjectDefinitionReader sample).Plese find details on :





(Sorry for spamming, i am replying here to reach you all quickly.. since this is where my whole project got struct)...


Is there any other way to map Include Segment number with DWF Data. I have even tried Content Defination -> DWFInstance but failed to map data since both nodeID from instance & include seg id are different.


am i missing some thing in whole process. Attached sample code on above post. Please help me out.


Thanks in advance.



Posts: 136
Registered: ‎06-07-2009
Message 7 of 7 (755 Views)

Re: Retrieving Object Names

07-15-2010 10:45 PM in reply to: varadd

Thank you for your question.


For 3D DWF, DWF Toolkit uses the opcode TKE_Tag to map an instance. The TKE_Tag count equals the instance node id. Then the named segment which includes the TKE_Tag will be mapped to the instance.


DWF Toolkit provides Object Definition and Content Definition (see sample ReadContentDefinition in DWF Toolkit) to record the instances. For the attached file “Blower_Frame.dwf”, instances are stored in Content Definition.


Please let me know if you have any further questions.



ADR/DWF Customer Support

Silvia Cao
SW Engineer
Autodesk, Inc.

You are not logged in.

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

Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

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

Ask the Community