DWF

Reply
Member
emanuel.ceballos
Posts: 4
Registered: ‎01-29-2013
Message 11 of 13 (648 Views)

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
SilviaCao
Posts: 136
Registered: ‎06-07-2009
Message 12 of 13 (638 Views)

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
emanuel.ceballos
Posts: 4
Registered: ‎01-29-2013
Message 13 of 13 (630 Views)

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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.