Message 1 of 2
Problem With Hatch Showing Solid
Not applicable
02-13-2019
12:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For some reason, When I add a hatch entity to my drawing from the API it shows up solid. If i click on it and bounce between pattern types it shows up normal... Any ideas? Below is the code snippet where I generate the hatch:
using (Polyline HatchL = new Polyline())
{
HatchL.AddVertexAt(0, new Point2d(Top.StartPoint.X, Top.StartPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(1, new Point2d(PanODL.StartPoint.X, PanODL.StartPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(2, new Point2d(PanODL.EndPoint.X, PanODL.EndPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(3, new Point2d(PanIDL.EndPoint.X, PanIDL.EndPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(4, new Point2d(PanIDL.StartPoint.X, PanIDL.StartPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(5, new Point2d(RingIDL.StartPoint.X, RingIDL.StartPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(6, new Point2d(RingIDL.EndPoint.X, RingIDL.EndPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(7, new Point2d(LeftSide.EndPoint.X, LeftSide.EndPoint.Y), 0, 0, 0);
HatchL.AddVertexAt(8, new Point2d(Top.StartPoint.X, Top.StartPoint.Y), 0, 0, 0);
blkRecord.AppendEntity(HatchL);
tr.AddNewlyCreatedDBObject(HatchL, true);
ObjectIdCollection col = new ObjectIdCollection();
col.Add(HatchL.ObjectId);
using (Hatch h = new Hatch())
{
blkRecord.AppendEntity(h);
tr.AddNewlyCreatedDBObject(h, true);
h.SetDatabaseDefaults();
h.SetHatchPattern(HatchPatternType.PreDefined, "ANSI32");
h.Associative = true;
h.AppendLoop(HatchLoopTypes.Outermost, col);
h.EvaluateHatch(true);
h.Layer = "10";
}
}