Hello Mary.
At first you can use the following code sample to fill existed circle object:
Code: Select all
CADCircle entCircle = (CADCircle)this.cadEditorControl.Image.Converter.Entities[i];
CADCurvePolygon entSolidHatch = new CADCurvePolygon();
CAD2DBoundaryList v2DBList = new CAD2DBoundaryList();
entSolidHatch.BoundaryData.Add(v2DBList);
CAD2DEllipse entBorder = new CAD2DEllipse();
v2DBList.Add(entBorder);
entBorder.CenterPoint = (CAD2DPoint)entCircle.Point;
entBorder.Radius = 1;
entBorder.MajorPoint = new CAD2DPoint(entCircle.Radius, 0);
entSolidHatch.Color = Color.Blue;
entSolidHatch.Extrusion = new DPoint(0, 0, 1);
entSolidHatch.Loaded(this.cadEditorControl.Image.Converter);
this.cadEditorControl.Image.Converter.OnCreate(entSolidHatch);
this.cadEditorControl.Image.CurrentLayout.AddEntity(entSolidHatch);
this.cadEditorControl.Invalidate();
Please note:
- solid hatch represented as CADCurvePolygon object;
- CADCurvePolygon object borders must be specified using 2D entities, properties of existed CADCircle used to specify CAD2DEllipse;
- CAD2DEllipse.Radius represents the relation of major to minor ellipse axes values, radius of 2d circle set as CAD2DEllipse.MajorPoint;
- CADCurvePolygon.Extrusion specifies 3D orientation (the direction of Z axis) of flat solid hatch entity.
However this code will result in solid filling above text object inside the circle. CAD Import .NET visualize entities correspond to CADEntitiesCollection indexes order. You need move text object in collection to visualize it over created solid hatch. For example:
Code: Select all
this.cadEditorControl.Image.Converter.Entities.Add(this.cadEditorControl.Image.Converter.Entities[j]);
this.cadEditorControl.Image.Converter.Entities.Remove(this.cadEditorControl.Image.Converter.Entities[j]);
this.cadEditorControl.Invalidate();
Alexander.