How to read Hatch entity ?
Moderators: SDS, support, admin
How to read Hatch entity ?
Hello
i want read entity CurvePolygon ( Hatch circle in joint image ) in a DXF File, for a conversion in my software dessin.
i must read each boundaries, vertex, line...or other entity ( if presents off course ).
i can not / Can you help me ?
Note : i want joint a image: BMP: not allowed !
JPG or PNG : Could not upload attachment to ./files/8725_3e4e85547ddfefc241dd38713166138f. ??
DXF : not alloweed ??
Bug or ??????????????????????
thanks / Pascal
my ( bad ) code :
vPoly: Tsg2DPolyline;
xP1,xP2: TF2DPoint;
sgCADCurvePolygon:TsgCADCurvePolygon;
vHatch: TsgCADCurvePolygon;
vBoundaryList: Tsg2DBoundaryList;
begin
if Sender is TsgCADCurvePolygon then
begin
sgCADCurvePolygon := Sender as TsgCADCurvePolygon;
i := sgCADCurvePolygon.Boundaries.Count;
O := sgCADCurvePolygon.Boundaries.Items[0];;
vBoundaryList := sgCADCurvePolygon.BoundaryData.Items[0];
i := vBoundaryList.Count;
for i := 0 to vBoundaryList.Count - 1 do
begin
vPoly := vBoundaryList.Items;
for j := 0 to vPoly.Count - 1 do
begin
xP1 := vPoly.StartPoint;
xP2 := vPoly.EndPoint;
i want read entity CurvePolygon ( Hatch circle in joint image ) in a DXF File, for a conversion in my software dessin.
i must read each boundaries, vertex, line...or other entity ( if presents off course ).
i can not / Can you help me ?
Note : i want joint a image: BMP: not allowed !
JPG or PNG : Could not upload attachment to ./files/8725_3e4e85547ddfefc241dd38713166138f. ??
DXF : not alloweed ??
Bug or ??????????????????????
thanks / Pascal
my ( bad ) code :
vPoly: Tsg2DPolyline;
xP1,xP2: TF2DPoint;
sgCADCurvePolygon:TsgCADCurvePolygon;
vHatch: TsgCADCurvePolygon;
vBoundaryList: Tsg2DBoundaryList;
begin
if Sender is TsgCADCurvePolygon then
begin
sgCADCurvePolygon := Sender as TsgCADCurvePolygon;
i := sgCADCurvePolygon.Boundaries.Count;
O := sgCADCurvePolygon.Boundaries.Items[0];;
vBoundaryList := sgCADCurvePolygon.BoundaryData.Items[0];
i := vBoundaryList.Count;
for i := 0 to vBoundaryList.Count - 1 do
begin
vPoly := vBoundaryList.Items;
for j := 0 to vPoly.Count - 1 do
begin
xP1 := vPoly.StartPoint;
xP2 := vPoly.EndPoint;
Re: How to read Hatch entity ?
Hello Pascal,
Have a look at the code example below, it shows how to read a center point and radius for an elliptic boundary of the filled circle:
Note: TsgCADCurvePolygon.BoundaryData is an array property starting from version 9.1.
Mikhail
Have a look at the code example below, it shows how to read a center point and radius for an elliptic boundary of the filled circle:
Code: Select all
procedure ReadHatchBoundaryParams(ACADImage: TsgCADImage; var ACenterPoint: TF2DPoint; var ARadius: TsgFloat);
var
I, J, K: Integer;
vCADCurvePolygon: TsgCADCurvePolygon;
v2DCurve: Tsg2DCurve;
begin
for I := 0 to ACADImage.Converter.Counts[csEntities] - 1 do
if ACADImage.Converter.Entities[I].EntType = ceCurvePolygon then
begin
vCADCurvePolygon := ACADImage.Converter.Entities[I] as TsgCADCurvePolygon;
for J := 0 to vCADCurvePolygon.BoundaryDataCount - 1 do
for K := 0 to vCADCurvePolygon.BoundaryData[J].Count - 1 do
begin
v2DCurve := vCADCurvePolygon.BoundaryData[J].Items[K];
if (v2DCurve.ClassName = 'Tsg2DArc') or (v2DCurve.ClassName = 'Tsg2DEllipse') then
begin
ACenterPoint := (v2DCurve as Tsg2DArc).CenterPoint;
ARadius := (v2DCurve as Tsg2DArc).Radius;
end;
end;
end;
end;
...
var
vCenterPoint: TF2DPoint;
vRadius: TsgFloat;
...
vCenterPoint := MakeF2DPoint(0,0);
vRadius := 0;
ReadHatchBoundaryParams(Img, vCenterPoint, vRadius);
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 5
- Joined: 26 Jun 2015, 18:10
Re: How to read Hatch entity ?
Hello
i use now this code to import Hatch entity ( TsgCADCurvePolygon ) sine a year.
With a new DWF file ( note : i want joint it : DWG file : The extension dwg is not allowed. ??!! )
the result is not corect : Please joint image.
- How read this DWG file ?
- it s possible to convert a Ellipse to line segement ( with NumberOfPartsInSpline ) : it s possible to convert TsgCADCurvePolygon entity to lines segment ( same ) ?
thanks for your help / Pascal Eynard
i use now this code to import Hatch entity ( TsgCADCurvePolygon ) sine a year.
With a new DWF file ( note : i want joint it : DWG file : The extension dwg is not allowed. ??!! )
the result is not corect : Please joint image.
- How read this DWG file ?
- it s possible to convert a Ellipse to line segement ( with NumberOfPartsInSpline ) : it s possible to convert TsgCADCurvePolygon entity to lines segment ( same ) ?
thanks for your help / Pascal Eynard
- Attachments
-
- Forum_Import_DWG_file.PNG (74.72 KiB) Viewed 34752 times
Re: How to read Hatch entity ?
Hello Pascal,
At first sight, your drawing algorithm doesn't seem to be quite correct. Please post the code of your drawing routine and send this DWG file to the Technical Support e-mail.
Mikhail
At first sight, your drawing algorithm doesn't seem to be quite correct. Please post the code of your drawing routine and send this DWG file to the Technical Support e-mail.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 5
- Joined: 26 Jun 2015, 18:10
Re: How to read Hatch entity ?
Hello, ok i m send this email, with my code and the DWG file
thanks for yours help
Pascal
thanks for yours help
Pascal