reading hatch with cadimport extended
Moderators: SDS, support, admin
reading hatch with cadimport extended
hello
i try to read CADEntities from dwg file. and for basic objects i create ReadCADentities function for these basics objects like in Import demo.
the question is, how to read a hatch objects....
if(Entity is CADPatternPolygon)
{
Import(Entity as CADPatternPolygon);
return;
}
should i use CADPatternPolygon or CADCurvePolygon. and more siginificant, how to access to coordinates?
i try to read CADEntities from dwg file. and for basic objects i create ReadCADentities function for these basics objects like in Import demo.
the question is, how to read a hatch objects....
if(Entity is CADPatternPolygon)
{
Import(Entity as CADPatternPolygon);
return;
}
should i use CADPatternPolygon or CADCurvePolygon. and more siginificant, how to access to coordinates?
Hello,
Thank you for the question. We will add this functionality to demo Import soon.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Thank you for the question. We will add this functionality to demo Import soon.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
We are preparing the updated version of CADImport .NET where your problem will be solved. Please wait for a while.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Hello,
We have sent you a letter.
Seregy.
please post questions to the forum or write to support@cadsofttools.com
We have sent you a letter.
Seregy.
please post questions to the forum or write to support@cadsofttools.com
Hello all,
We have made necessary changes. Updated version of CADImport .NET is available on: http://www.cadsofttools.com/download/cadimportnet.zip
The following code works:
If necessary please write us on info@cadsofttool.com for getting CADImport .NET with full versions of demo applications (<b>AddEntityDemo</b>, <b>MergeFilesDemo</b>and <b>Import</b>).
Sergey.
please post questions to the forum or write to support@cadsofttools.com
We have made necessary changes. Updated version of CADImport .NET is available on: http://www.cadsofttools.com/download/cadimportnet.zip
The following code works:
Code: Select all
<b>private string</b>[] hatchStyle = <b>new string</b> [8 ]{"BDiagonal", "Cross", "DiagCross", "FDiagonal",
"Horizontal", "PatternData", "Solid", "Vertical"};
<b>private void</b> ImportHatch(CADPatternPolygon Sender)
{
CADHatchStyle style;
DPoint P;
RectangleF hatchbox;
<b>string</b> S = "";
S = S + "HatchName = " + Sender.HatchName;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
style = Sender.HatchStyle;
S = S + "HatchStyle = " + hatchStyle[(<b>int</b>)style];
S = S + (<b>char</b>)13 + (<b>char</b>)10;
S = S + "Color = " + Sender.Color.Name;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
P = CADParams.matrix.PtXMat(Sender.Elevation);
S = S + "Elevation: ";
S = S + " X=" + P.X;
S = S + " Y=" + P.Y;
S = S + " Z=" + P.Z;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
P = CADParams.matrix.PtXMat(Sender.Extrusion);
S = S + "Extrusion: ";
S = S + " X=" + P.X;
S = S + " Y=" + P.Y;
S = S + " Z=" + P.Z;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
//GetHatchPoints(Sender); - getting the real screen coordinates
GraphicsPath pth1 = FCADImage.GetHatchPointsInAbsCoords(Sender);
S = S + "Hatch box: ";
hatchbox = pth1.GetBounds();
S = S + " Left= " + hatchbox.Left;
S = S + " Top = " + hatchbox.Top;
S = S + " Right = " + hatchbox.Right;
S = S + " Bottom = " + hatchbox.Bottom;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
S = S + "Hatch points: ";
S = S + (<b>char</b>)13 + (<b>char</b>)10;
<b>for</b>(<b>int</b> i = 0; i < pth1.PathPoints.Length; i++)
{
S = S + "Point[" + i + "] ";
S = S + " X=" + pth1.PathPoints[i].X;
S = S + " Y=" + pth1.PathPoints[i].Y;
S = S + (<b>char</b>)13 + (<b>char</b>)10;
}
TextFile.Add(S);
}
Sergey.
please post questions to the forum or write to support@cadsofttools.com
hi.....this work fine....i got all the points of the hatch...
but i have one more question?
when i read the hatch....they may contains lines or splines like part between two point....
and GraphicPath object have, for each point in PathPoints array, the type of the point.
<b>
PathPointTypeStart = 0,
PathPointTypeLine = 1,
PathPointTypeBezier = 3,
PathPointTypePathTypeMask = 0x7,
PathPointTypePathDashMode = 0x10,
PathPointTypePathMarker = 0x20,
PathPointTypeCloseSubpath = 0x80,
PathPointTypeBezier3 = 3
</b>
problem is: when i read all pointtypes, a have PathPointTypeLine for each point except the first, first is PathPointTypeStart? but the hetch have some splines between points?
but i have one more question?
when i read the hatch....they may contains lines or splines like part between two point....
and GraphicPath object have, for each point in PathPoints array, the type of the point.
<b>
PathPointTypeStart = 0,
PathPointTypeLine = 1,
PathPointTypeBezier = 3,
PathPointTypePathTypeMask = 0x7,
PathPointTypePathDashMode = 0x10,
PathPointTypePathMarker = 0x20,
PathPointTypeCloseSubpath = 0x80,
PathPointTypeBezier3 = 3
</b>
problem is: when i read all pointtypes, a have PathPointTypeLine for each point except the first, first is PathPointTypeStart? but the hetch have some splines between points?
There are two hatch types - solid and with inside hatching.
1. For solid hatches: method public GraphicsPath GetHatchPoints(CADPatternPolygon vHatch) returns a set of hatch borders in screen coordinates as GraphicsPath object. The returned GraphicsPath is fully filled object in this case.
It is necessary to consider PathTypes if you need selecting of the whole border. (You can find additional information on the following page: http://msdn.microsoft.com/library/defau ... stopic.asp)
2. For hatches with inside hatching: method public GraphicsPath GetHatchPoints(CADPatternPolygon vHatch) returns a set of hatch borders as GraphicsPath.PathPoints. In this case PathTypes stays underfilled
Sergey.
please post questions to the forum or write to support@cadsofttools.com
1. For solid hatches: method public GraphicsPath GetHatchPoints(CADPatternPolygon vHatch) returns a set of hatch borders in screen coordinates as GraphicsPath object. The returned GraphicsPath is fully filled object in this case.
It is necessary to consider PathTypes if you need selecting of the whole border. (You can find additional information on the following page: http://msdn.microsoft.com/library/defau ... stopic.asp)
2. For hatches with inside hatching: method public GraphicsPath GetHatchPoints(CADPatternPolygon vHatch) returns a set of hatch borders as GraphicsPath.PathPoints. In this case PathTypes stays underfilled
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Could you please explain what are the main and intermediate tasks that you have?
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Sergey.
please post questions to the forum or write to support@cadsofttools.com
i must convert DWG file to SWF.... that is main task.
the hatches are most frequent objects, so i need to know what are they,
exactly, i need all data about hatches: border points, border point types, fill color....(border color if exists)
i need all that for SOLID hatch object. i use other library to write SWF file.
that is my job.
the hatches are most frequent objects, so i need to know what are they,
exactly, i need all data about hatches: border points, border point types, fill color....(border color if exists)
i need all that for SOLID hatch object. i use other library to write SWF file.
that is my job.