Page 1 of 2
reading hatch with cadimport extended
Posted: 21 Jun 2006, 18:59
by fare
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?
Posted: 22 Jun 2006, 11:44
by support
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
Posted: 22 Jun 2006, 11:48
by fare
ok
thanks
but my question is still here
[:)]
Posted: 23 Jun 2006, 12:13
by fare
please....can anyone help me...i need this very fast [:(]
Posted: 23 Jun 2006, 13:38
by support
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
Posted: 23 Jun 2006, 15:06
by fare
[:(]
Posted: 23 Jun 2006, 15:14
by SDS
Please contact us on
support@cadsofttools.com. We need your email.
Sergey.
Posted: 23 Jun 2006, 16:09
by fare
Posted: 23 Jun 2006, 16:59
by support
Hello,
We have sent you a letter.
Seregy.
please post questions to the forum or write to
support@cadsofttools.com
Posted: 27 Jun 2006, 19:52
by support
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:
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);
}
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
Posted: 28 Jun 2006, 18:08
by fare
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?
Posted: 28 Jun 2006, 20:15
by support
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
Posted: 29 Jun 2006, 14:13
by fare
that is ok, but when i read PointType, all i have is PathPointTypeLine for every point, and for every hatch
Posted: 29 Jun 2006, 15:25
by support
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
Posted: 29 Jun 2006, 16:47
by fare
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.