Thank you!
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by support</i>
<br />Hello,
For DXF ?DWG files:
(TsgDXFImage*)(sgPaintBox->Picture->Graphic)->CurrentLayout->PlotSettings.PlotPaperUnits
if (PlotPareUnits==0) then inches, otherwise millimeters.
For HPGL files:
The size of file in millimeters may be obtain using
(TsgHPGLImage *)(sgPaintBox->Picture->Graphic)->MMWidth / 100.
void TForm1::SetPnlSizeCaption(void)
{
TFPoint vPt;
TsgDXFImage *vImg;
TsgHPGLImage *vHPGLImg;
if (!sgPaintBox->Empty())
{
if (sgPaintBox->Picture->Graphic->ClassType() == __classid(TsgHPGLImage))
{
vHPGLImg = (TsgHPGLImage *)(sgPaintBox->Picture->Graphic);
TVarRec v1[] = {vHPGLImg->MMWidth / 100.0, vHPGLImg->MMHeight / 100.0};
pnlSize->Caption = Format("%.3f mm x %.3f mm", v1, 1);
}
else
if (sgPaintBox->Picture->Graphic->InheritsFrom(__classid(TsgDXFImage)))
{
vImg = (TsgDXFImage *)(sgPaintBox->Picture->Graphic);
TVarRec v[] = {vImg->AbsWidth(), vImg->AbsHeight()};
if (vImg->CurrentLayout->PlotSettings.PlotPaperUnits == 0)
pnlSize->Caption = Format("%.3f in x %.3f in", v, 1);
else
pnlSize->Caption = Format("%.3f mm x %.3f mm", v, 1);
}
}
}
Sergey.
please post questions to the forum or write to
support@cadsofttools.com
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">