reading hatch with cadimport extended

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

fare
Posts: 10
Joined: 24 May 2006, 18:11

reading hatch with cadimport extended

Post by fare » 21 Jun 2006, 18:59

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?

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

Post by support » 22 Jun 2006, 11:44

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

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 22 Jun 2006, 11:48

ok
thanks

but my question is still here

[:)]

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 23 Jun 2006, 12:13

please....can anyone help me...i need this very fast [:(]

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

Post by support » 23 Jun 2006, 13:38

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

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 23 Jun 2006, 15:06

[:(]

SDS
Posts: 21
Joined: 12 Mar 2004, 11:16
Location: Russia
Contact:

Post by SDS » 23 Jun 2006, 15:14

Please contact us on support@cadsofttools.com. We need your email.

Sergey.

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 23 Jun 2006, 16:09


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

Post by support » 23 Jun 2006, 16:59

Hello,

We have sent you a letter.

Seregy.

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

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

Post by support » 27 Jun 2006, 19:52

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

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 28 Jun 2006, 18:08

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?

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

Post by support » 28 Jun 2006, 20:15

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

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 29 Jun 2006, 14:13

that is ok, but when i read PointType, all i have is PathPointTypeLine for every point, and for every hatch

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

Post by support » 29 Jun 2006, 15:25

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

fare
Posts: 10
Joined: 24 May 2006, 18:11

Post by fare » 29 Jun 2006, 16:47

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.

Post Reply