DWF

Reply
Contributor
TheUnknown
Posts: 20
Registered: ‎08-04-2006
Message 1 of 7 (846 Views)

Retrieving Object Names

846 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
jasona
Posts: 55
Registered: ‎12-01-2005
Message 2 of 7 (846 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.

Cheers
Jason
Contributor
TheUnknown
Posts: 20
Registered: ‎08-04-2006
Message 3 of 7 (846 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.
Contributor
TheUnknown
Posts: 20
Registered: ‎08-04-2006
Message 4 of 7 (846 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
jasona
Posts: 55
Registered: ‎12-01-2005
Message 5 of 7 (846 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.

Cheers
Jason Anderssen
Active Member
varadd
Posts: 10
Registered: ‎06-17-2010
Message 6 of 7 (843 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 :

 

http://forums.autodesk.com/t5/DWF/failed-to-get-ObjectDefinition-to-traverse-through-complete-tree/t...

 

 

(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.

 

-Varad

Employee
SilviaCao
Posts: 136
Registered: ‎06-07-2009
Message 7 of 7 (811 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.

 

Silvia

ADR/DWF Customer Support



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.