DWF

DWF

Reply
Member
4 Posts
0 Kudos
Registered: ‎01-29-2013
Post 11 of 13

Re: how to get geometry data from DWF file

02-18-2013 06:44 AM in reply to: SilviaCao

Hi Silvia, thanks very much for your answer. I've managed to read the ObjectDefinition, this returns a list of DWFDefinedObjectInstance and I'm adding new properties to these Instances using pInst->addProperty( DWFCORE_ALLOC_OBJECT(DWFProperty(L"my_name", L"my_value", L"my_category")), true );

 

What I can't find is a way to save the modifications to the DWF and the ObjectDefinition. What's the correct way to do this?

 

Thanks.

Emanuel Ceballos
ENGworks - Software Developer
Employee
136 Posts
3 Kudos
Registered: ‎06-07-2009
Post 12 of 13

Re: how to get geometry data from DWF file

02-18-2013 07:03 PM in reply to: emanuel.ceballos

You can save the new object definition resource by DWFObjectDefinitionResource::serializeXML; here is a code snapshot:

DWFPointer<DWFBufferOutputStream> apOutputStream( DWFCORE_ALLOC_OBJECT(DWFBufferOutputStream(_DWFTK_OBJECT_DEFINITION_RESOURCE_INITIAL_BUFFER_BYTES)), false );

DWFUUID oUUID;

DWFPointer<DWFXMLSerializer> apSerializer( DWFCORE_ALLOC_OBJECT(DWFXMLSerializer(oUUID)), false );

apSerializer->attach( apOutputStream );

objectdefinitionresource->serializeXML( apSerializer, DWFPackageWriter::eObjectDefinition );

apSerializer->detach();

The code is to create a new stream of the object definition resource; then you can create a new DWFObjectDefinitionResource and attach the new stream.



Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Member
4 Posts
0 Kudos
Registered: ‎01-29-2013
Post 13 of 13

Re: how to get geometry data from DWF file

02-19-2013 05:13 AM in reply to: SilviaCao

Thank you very much Silvia. I will try it and let you know.

Emanuel Ceballos
ENGworks - Software Developer
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!