Add Hatch to Ellipse
Moderators: SDS, support, admin
Add Hatch to Ellipse
Hello,
I have a .dxf file just contain 1 ellipse entity.
how can i add hatch on it ?
I have a .dxf file just contain 1 ellipse entity.
how can i add hatch on it ?
Re: Add Hatch to Ellipse
Hello!
Please try the following code (based on Viewer demo):
Sergey.
Please try the following code (based on Viewer demo):
Code: Select all
private void btnAddHatchOnEllipsePoints_Click(object sender, System.EventArgs e)
{
if(this.cadImage == null)
{
this.cadImage = new CADImage();
this.cadImage.InitialNewImage();
this.cadImage.UseDoubleBuffering = false;
}
this.cadImage.UseDoubleBuffering = false;
int entCount = this.cadImage.Converter.GetCounts(CADImport.FaceModule.ConvSection.Entities);
for(int i=0;i<entCount;i++)
{
if(this.cadImage.Converter.GetSection(CADImport.FaceModule.ConvSection.Entities).Entities[i] is
CADEllipse)
{
CADEllipse entEllipse =
(CADEllipse)this.cadImage.Converter.GetSection(CADImport.FaceModule.ConvSection.Entities).Entities[i];
CADHatch Hatch = new CADHatch();
Hatch.HatchName = "ANSI31";
CAD2DBoundaryList v2DBList = new CAD2DBoundaryList();
v2DBList.BoundaryType = 7;// Polyline type
Hatch.BoundaryData.Add(v2DBList);
CAD2DPolyline v2DPolyline = new CAD2DPolyline();
v2DBList.Add(v2DPolyline);
CAD2DPoint ent2DPoint;
DPoint Point;
for(int j=0;j<entEllipse.PolyPoints.Count;j++)
{
Point = (DPoint)entEllipse.PolyPoints[j];
ent2DPoint = new CAD2DPoint(Point.X,Point.Y);
v2DPolyline.Vertexes.Add(ent2DPoint);
}
v2DPolyline.Closed = true;
Hatch.Color = Color.Azure;
HatchPatternData vHPData = new HatchPatternData();
vHPData.baseP = new DPoint(0, 0, 0);
vHPData.offset = new DPoint(300, 300, 0);
vHPData.lineAngle = 40.0f;
vHPData.isDash = false;
vHPData.lines = null;
vHPData.dashNum = 0;
Hatch.HatchPatternData.Add(vHPData);
Hatch.Loaded(this.cadImage.Converter);
this.cadImage.CurrentLayout.Entities.Add(Hatch);
this.cadImage.Converter.OnCreate(Hatch);
}
}
this.ResizeLayout();
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Add Hatch to Ellipse
Dear Sergey,
Thanks for your reply. I can add hatch to the ellipse entity now.
Is there a common way to add hatch on diffrent kind entity ? (such as circle, ellipse, PolyLine ....)
I have another question :
I use the “MergeFilesDemoSite” program to merge 3 dxf files and save as a new .dxf file, but when I open the new .dxf file with “ViewerControlDemo “ program I got nothing (cann’t see anything), could you tell me the cause?
Thanks,
Anderson
Thanks for your reply. I can add hatch to the ellipse entity now.
Is there a common way to add hatch on diffrent kind entity ? (such as circle, ellipse, PolyLine ....)
I have another question :
I use the “MergeFilesDemoSite” program to merge 3 dxf files and save as a new .dxf file, but when I open the new .dxf file with “ViewerControlDemo “ program I got nothing (cann’t see anything), could you tell me the cause?
Thanks,
Anderson
Re: Add Hatch to Ellipse
Dear Anderson,
We will inform you when it is solved.
Sergey.
The common way is just as it was shown in the code example. Generally saying every new hatch requires personal solution.Is there a common way to add hatch on diffrent kind entity ? (such as circle, ellipse, PolyLine ....)
We have found this problem.I have another question :
I use the “MergeFilesDemoSite” program to merge 3 dxf files and save as a new .dxf file, but when I open the new .dxf file with “ViewerControlDemo “ program I got nothing (cann’t see anything), could you tell me the cause?
We will inform you when it is solved.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Add Hatch to Ellipse
Hello!
Please contact us via e-mail to support@cadsofttools.com accordingly the question of getting updated beta version of the library.
Sergey.
The problem has been solved.We have found this problem.I have another question :
I use the “MergeFilesDemoSite” program to merge 3 dxf files and save as a new .dxf file, but when I open the new .dxf file with “ViewerControlDemo “ program I got nothing (cann’t see anything), could you tell me the cause?
We will inform you when it is solved.
Please contact us via e-mail to support@cadsofttools.com accordingly the question of getting updated beta version of the library.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support