What is Unit?

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
mangchy
Posts: 15
Joined: 08 Nov 2005, 03:06

What is Unit?

Post by mangchy » 24 Nov 2005, 08:48

Hi!
C++ Builder 6.0
CADImportVCL

What is unit?

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 24 Nov 2005, 11:14

Hello,

Folder CADImportVCL\CBuilder\Units contains forms and unit files of demos common for C++Builder 4, C++Builder 5 and C++Builder 6. Folders:
CADImportVCL\CBuilder\BCB4
CADImportVCL\CBuilder\BCB5
CADImportVCL\CBuilder\BCB6
contain separate libraries and project files of demos for different versions of C++Builder.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

mangchy
Posts: 15
Joined: 08 Nov 2005, 03:06

Post by mangchy » 24 Nov 2005, 16:04

Ok, I'm sorry.
Want to know distance unit of graphic image..mm? inch? ..



<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,

Folder CADImportVCL\CBuilder\Units contains forms and unit files of demos common for C++Builder 4, C++Builder 5 and C++Builder 6. Folders:
CADImportVCL\CBuilder\BCB4
CADImportVCL\CBuilder\BCB5
CADImportVCL\CBuilder\BCB6
contain separate libraries and project files of demos for different versions of C++Builder.

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">

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Post by support » 24 Nov 2005, 18:38

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

mangchy
Posts: 15
Joined: 08 Nov 2005, 03:06

Post by mangchy » 07 Dec 2005, 13:52

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">

Post Reply