DWF

Reply
Contributor
geotavros
Posts: 15
Registered: ‎03-27-2012
Message 1 of 4 (1,056 Views)

How to read drawable objects from 2D DWF file?

1056 Views, 3 Replies
04-24-2012 08:19 AM

I've used this sample code to read a 2D DWF file. I want to get Lines, Polylines, Text and other drawable objects from the DWF file but all I get is this list of object's types:

Spoiler

DWF_Header_ID

Creator_ID

Creation_Time_ID

Modification_Time_ID

Source_Filename_ID

Source_Creation_Time_ID

Source_Modification_Time_ID

Units_ID

Title_ID

Embed_ID

Named_View_ID

Named_View_ID

View_ID

Plot_Info_ID

Optimized_For_Plot_ID

Color_ID

Layer_ID

Font_Extension_ID

Font_ID

 How can I get those drawable entities?

 

I'm using OS X Lion and XCode 4.3.2.

I've attached my source code and DWF file

 

For reading DWFx files I used this code and it works. It reads polyline and text objects.

 

 

Edited by
Discussion_Admin

Contributor
geotavros
Posts: 15
Registered: ‎03-27-2012
Message 2 of 4 (1,039 Views)

Workaround

04-25-2012 07:05 AM in reply to: geotavros

I've found the problem. while loop breaks because of 

WT_Result::Unsupported_DWF_Opcode is returned from 

process_next_object(). This example code doesn't break the loop on this error, and continues until some other error happens:

do {
            r = inputStream.process_next_object();
            const WT_Object* obj = inputStream.current_object();
            if (obj)
                printObjectType(obj->object_id());
            // we can serialize the obj to another file
            cout << r << endl;
} while (r == WT_Result::Success || r == WT_Result::Unsupported_DWF_Opcode);

 

 

New Member
edporras
Posts: 2
Registered: ‎09-19-2012
Message 3 of 4 (896 Views)

Re: How to read drawable objects from 2D DWF file?

09-19-2012 03:31 PM in reply to: geotavros

Hi,

 

I'm working on a small project trying to do the same and was wondering if you could point me to the example you used. I didn't see any files attached to the message?

 

Hoping you can help. Thanks.

 

Contributor
geotavros
Posts: 15
Registered: ‎03-27-2012
Message 4 of 4 (884 Views)

Re: How to read drawable objects from 2D DWF file?

09-21-2012 02:19 AM in reply to: edporras

I don't know where is it gone. Or if the link was removed. There is an example of 2D reading on this forum, find it. it is very helpful

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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