DWF
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi, I'm doing a DWF viewer right now, but I've met some problems with the layout for the extracted objects.
I found that if only one or no WT_Origin informaton within a DWF file, my model will be displayed correctly, but I got more than one origin points read from the file, the layout of the model will be totally mess.
So I wanna know how the origin points being sorted in the file, is ONE ORIGIN could be refered by MULTIPLE points? Or the position of objects are decided by layers?
Thank you a lot if you can help me, this problem has been tortured a long time...
Solved! Go to Solution.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you for your questions.
The WT_Origin defines an absolute point in drawing coordinates used to reset the relative coordinate processing. The DWF Toolkit will process the WT_Origin object automatically when reading the DWF file; so if your model processes the WT_Origin object, please skip the WT_Origin object.
Please let me know if you have any further questions.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Silvia:
Thank you for your reply.
I did what you told me, things get little better, but the model still has some abnormal offset.
Do I need to do anything about layers? Or something with WT_View and WT_Units? Because I think they defined the translation of the model.
What am doing now is extract the points directly from W2D objects then scale them to a propery size before drawing them on the screen, is anything wrong with the process?
Again, thank you for your time.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Yes, you need to process the WT_Units, which defines the translation of the model.
And your process is correct.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi, Silvia:
I still got problem with this issue, when I process models with just one WT_Origin, the layout will be corret, but if I met model with multiple WT_Origin, the individual objects in the model will scatter all around the screen, which is definitely wrong.
How should I solve this issue? It has bothered me more than a week![]()
Thank you!
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Could you please send us more information to research?
- Please send us a snapshot of the model; it is better if you can send us the original DWF file.
- Please send us a snapshot of your source code to read the DWF objects.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Silvia:
I really appreciate your help, the files you want are in the attachment.
DSTA-BCA_v5.dwf is the DWF file I'm using to test.
WrongDisplay.png is the output of my program which I'm using OpenGL to render.
Code.txt is containing how I parse the WT_Unit, WT_View and WT_Polyline.
Please let me know when you found anything wrong!
Thank you!
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
In the “Code.txt”, function “getUnits”, what does the “m_transformMatDWF” use to do? Please comment the function “getUnits” and try again.
And could you please send us more codes from extracting the DWF file to calling the function getUnits()?

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Silvia:
Thank you for your reply.
I just use m_transformMatDWF[0] and m_transformMatDWF[5] as scale parameter to scale my model, I didn't do any translation with them.
And the code you ask is in the attachment.
Thank you!
Re: DWF Toolkit origin
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Please replace the “get_next_object()” with “process_next_object()” in function rewriteW2D(), and test again.

Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.



