How can I use TsgDXFHatch In D7?
Moderators: SDS, support, admin
How can I use TsgDXFHatch In D7?
how to hatch a circle or a Rect? show me a demo,pleaese!
Hello,
CADImportVCL (http://www.cadsofttools.com/download/CADImportVCL.zip) in correspondent lib folders (for different Delphi and C++ Builder versions) containes DXFImage.pas. We would like you to pay attention on
in DXFImage.pas module.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
CADImportVCL (http://www.cadsofttools.com/download/CADImportVCL.zip) in correspondent lib folders (for different Delphi and C++ Builder versions) containes DXFImage.pas. We would like you to pay attention on
Code: Select all
procedure TsgDXFImage.DrawHatch(Sender: TObject);
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Dear lhasha,
We have no special Demo program that demonstrates the way of drawing Hatches. Module DXFImage.pas is being used in View demo for drawing all types of hatches from CAD files (AutoCAD: DWG, DXF; Hewlett-Packard HPGL; Scalable Vector Graphics: SVG; Computer Graphics Metafile: CGM) . This functionality is implemented in mentioned above
This demo is available in CADImportVCL package:
for Delphi:
CADImportVCL\Delphi\Demos\Viewer
for C++ Builder 6.0:
CADImportVCL\CBuilder\BCB6\Viewer
Module DXFImage.pas is in correspondent Lib folders:
for Delphi:
CADImportVCL\Delphi\Lib[2005win32] [7][6][5][4][3]
for C++ Builder:
CADImportVCL\CBuilder\BCB[6]\Lib [5][4]
Sergey
please post questions to the forum or write to support@cadsofttools.com
We have no special Demo program that demonstrates the way of drawing Hatches. Module DXFImage.pas is being used in View demo for drawing all types of hatches from CAD files (AutoCAD: DWG, DXF; Hewlett-Packard HPGL; Scalable Vector Graphics: SVG; Computer Graphics Metafile: CGM) . This functionality is implemented in mentioned above
Code: Select all
procedure TsgDXFImage.DrawHatch(Sender: TObject);
for Delphi:
CADImportVCL\Delphi\Demos\Viewer
for C++ Builder 6.0:
CADImportVCL\CBuilder\BCB6\Viewer
Module DXFImage.pas is in correspondent Lib folders:
for Delphi:
CADImportVCL\Delphi\Lib[2005win32] [7][6][5][4][3]
for C++ Builder:
CADImportVCL\CBuilder\BCB[6]\Lib [5][4]
Sergey
please post questions to the forum or write to support@cadsofttools.com
Dear lhasha,
We need a couple of days to prepare a special demo with example of creating hatches.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
We need a couple of days to prepare a special demo with example of creating hatches.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Hello!
The following code works with <b>CAD Import VCL v.6.1</b>:
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
The following code works with <b>CAD Import VCL v.6.1</b>:
Code: Select all
<b>procedure</b> TForm1.btnHatchOnPolyClick(Sender: TObject);
<b>var</b>
vPolyHatch: TsgCADCurvePolygon;
v2DBList: Tsg2DBoundaryList;
v2DPoly: Tsg2DPolyline;
vPoly: TsgDXFPolyline;
vVertex: TsgDXFVertex;
K, J, CNt: Integer;
vImg: TsgDXFImage;
<b>begin
if</b> sgPaintBox.Picture.Graphic <b>is</b> TsgDXFImage <b>then</b>
vImg := TsgDXFImage(sgPaintBox.Picture.Graphic)
<b>else</b>
Exit;
CNt := vImg.CurrentLayout.Count - 1;
<b>for</b> K :=0 <b>to</b> CNt <b>do
begin
if</b> vImg.CurrentLayout.Entities[K] <b>is</b> TsgDXFPolyline <b>then
begin</b>
vPoly := TsgDXFPolyline(vImg.CurrentLayout.Entities[K]);
vPolyHatch := TsgCADCurvePolygon.Create;
vImg.CurrentLayout.AddEntity(vPolyHatch);
vPolyHatch.Color := clRed;
v2DBList := Tsg2DBoundaryList.Create;
vPolyHatch.BoundaryData.Add(v2DBList);
v2DBList.BoundaryType := 7;<i><font color="blue">// Polyline type</i></font id="blue">
v2DPoly := Tsg2DPolyline.Create;
v2DBList.Add(v2DPoly);
<b>for</b> J := 0 <b>to</b> vPoly.Count - 1 <b>do
begin</b>
vVertex := TsgDXFVertex(vPoly.Entities[J]);
v2DPoly.AddVertex(MakeF2DPoint(vVertex.Point.X , vVertex.Point. Y));
<b>end</b>;
<b>if</b> vPoly.Closed <b>then
begin</b>
vVertex := TsgDXFVertex(vPoly.Entities[0]);
v2DPoly.AddVertex(MakeF2DPoint(vVertex.Point.X , vVertex.Point. Y));
<b>end</b>;
<b>if</b> Assigned(vImg.Converter.OnCreate) <b>then</b>
vImg.Converter.OnCreate(vPolyHatch);
vImg.Converter.Loads(vPolyHatch);
<b>end</b>;
<b>end</b>;
vImg.GetExtents;
sgPaintBox.Invalidate;
<b>end</b>;
Please post questions to the forum or write to support@cadsofttools.com