Scale DXF to map resolution.
Moderators: SDS, support, admin
Scale DXF to map resolution.
Hello, please can you help me?. I need import DXF file on which is draw MAP of plants. But i need gets actual file "map scale" and calculate new scale.
Etc. I need view map in scale 1:58000 (in JTSK coords system , units are meters). I know that DXF file is in same coords system (JTSK). But i dont know how works scaling. In manual this information missing
Our componaty bought CADVCL 10.0 Import. Can you help me please? I need samo theory about scaling. Thank you very much.
Peter
Please so sorry for my english.
Etc. I need view map in scale 1:58000 (in JTSK coords system , units are meters). I know that DXF file is in same coords system (JTSK). But i dont know how works scaling. In manual this information missing

Peter
Please so sorry for my english.
Re: Scale DXF to map resolution.
Hello Peter,
to get an answer in this forum is definitely Lotterie and in the manual is quasi "every information missing".
I have no Idea of JTSK (seems to be special Czech stuff?). Maybe, try like this: Have a Look at the
ImportExample, add to the Points the Viewport and multiply the coordinates with a Factor.
In my Software, I have it like this:
To get just a Scaled Graphic of the dxf:
Hope it helps, kind regards, happy New Year from Mannheim,
Thomas
to get an answer in this forum is definitely Lotterie and in the manual is quasi "every information missing".

I have no Idea of JTSK (seems to be special Czech stuff?). Maybe, try like this: Have a Look at the
ImportExample, add to the Points the Viewport and multiply the coordinates with a Factor.
In my Software, I have it like this:
Code: Select all
// CADImage.IsWithoutBorder = true,
// DrawingExtents = CADImage.GetDrawingExtents,
// P from CADIterate (ImportLine, ImportPolyLine ect..),
// Factor = ScaleFactor * UnitFactor,
// ScaleFactor = 1 / 58000,
// UnitFactor = 1? (dxfUnitToMM),
P.X := (P.X + ViewPort.X - DrawingExtents.Left) * Factor;
P.Y := (DrawingExtents.Top - P.Y - ViewPort.Y) * Factor;
Code: Select all
// CADImage.IsWithoutBorder = true
// Factor = ScaleFactor * UnitFactor,
// ScaleFactor = 1 / 58000,
// UnitFactor = 1? (dxfUnitToMM)
FRect.Left := 0;
FRect.Top := 0;
FRect.Right := Round(FFactor * PixelsPerInch / 25.4 * FsgCADImage.AbsWidth);
FRect.Bottom := Round(FFactor * PixelsPerInch / 25.4 * FsgCADImage.AbsHeight);
FMetafile.Width := FRect.Right;
FMetafile.Height := FRect.Bottom;
MC := TMetafileCanvas.Create(FMetafile, 0);
try
MC.StretchDraw(FRect, FsgCADImage);
finally
MC.Free;
end;
Thomas
Re: Scale DXF to map resolution.
Hello Thomas, thank you very much for reply.
Really, manual for CadSoft is very pure
( I have this library few days in hand and understand it everytihing from code is hardcore 
Yes, JTSK is special czech coording system like WGS84 etc. But this not important for solution.
I´ll try your sample code.
Thank you , and all good to this new year
Peter.
Really, manual for CadSoft is very pure


Yes, JTSK is special czech coording system like WGS84 etc. But this not important for solution.
I´ll try your sample code.
Thank you , and all good to this new year

Peter.
Re: Scale DXF to map resolution.
Hello,
We were on holidays, so we couldn't answer on time. Thanks to Thomas for his post.
Mikhail
We were on holidays, so we couldn't answer on time. Thanks to Thomas for his post.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support