• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    DWF

    Reply
    Member
    Posts: 4
    Registered: ‎01-29-2013

    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
    Please use plain text.
    Employee
    Posts: 136
    Registered: ‎06-07-2009

    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.
    Please use plain text.
    Member
    Posts: 4
    Registered: ‎01-29-2013

    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
    Please use plain text.