DWF

DWF

Reply
Member
3 Posts
0 Kudos
Registered: ‎08-06-2012
Post 1 of 2

Incorrect coordinate geometry in dwfx

689 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
3 Posts
0 Kudos
Registered: ‎08-06-2012
Post 2 of 2

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.

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post