DWF

Reply
Member
PedroUdjat
Posts: 3
Registered: ‎08-06-2012
Message 1 of 2 (680 Views)

Incorrect coordinate geometry in dwfx

680 Views, 1 Replies
08-06-2012 10:51 AM

Hi everyone,

 

I have a problem extracting dwg coordinate geometry from a dwfx file.

 

Using as an example the W2Dtest sample and the Read2DDWFxFile.cpp file, I get all the Whip coordinates.

 

For example:

 

2147467780, 8657

2147468114, 9319

 

I read in this topic that the coordinates appear correct:

http://forums.autodesk.com/t5/DWF/DWF-geometry-data/td-p/1887709/page/2

 

 

But when I  try to convert this coordinates to the original AutoCAD DWG coordinates, using first:

 

WT_Matrix xform3d( pGraphicsRes->transform() );
DWFToolkit::smileyvery-happy:WFPaper *pPaper( pEPlotSxn->paper() );
WT_Matrix2D xform;
xform(0,0) = xform3d(0,0);
xform(1,0) = xform3d(1,0);
xform(0,1) = xform3d(0,1);
xform(1,1) = xform3d(1,1);
xform(2,0) = xform3d(3,0);
xform(2,1) = xform3d(3,1);

XAMLFile->definePageLayout(xform, pPaper->width(), pPaper->height(),
pPaper->units() == DWFToolkit::smileyvery-happy:WFPaper::eMillimeters ? .03937 : 1.0 );

 

 

and then for each point:

 

WT_Point3D correctCoord = units.transform_from_DWF_to_application(newPoint); 

 

 

i get coordinates like this:

 

2142.55, 1011.14

2143.25, 1012.54

 

where I should be getting coordinates like this:

 

4543646.5803, 9.195

4545674.8390, 8.498

 

 

Any ideia what i'm doing wrong? Am I missing something? Any help is appreciated.

 

 

Thanks, 

 

Pedro Cruz

Member
PedroUdjat
Posts: 3
Registered: ‎08-06-2012
Message 2 of 2 (672 Views)

Re: Incorrect coordinate geometry in dwfx

08-10-2012 03:09 AM in reply to: PedroUdjat

Anyone?

 

I noticed that the the matrix that I get from WT_Units:

WT_Matrix original = units.application_to_dwf_transform();

 

have some correct values, and some other strange values like 2,89e-14. Is this normal? I could alter the values in the transformation matrix but I don't think that is the correct approach.

 

And i should be using units.transform_from_DWF_to_application(), not units.application_to_dwf_transform(), because I want the original DWG coordinates, but the output coordinates makes even less sense.

 

Any ideas? I'm really at a loss here.

 

Thanks,

 

Pedro Cruz.

 

 

 

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.