狐哥,我想定义填充色的边界,即一个外边界,一个内边界,为什么这样填充没有效果啊List<Entity> loopents = new List<Entity> { new Circle(new Point3d(0, 0, 0), Vector3d.ZAxis, 3) };
ObjectIdCollection loopids = new ObjectIdCollection(loopents.Select(ent => AddEntity(tr, blkdef, ent)).ToArray());
List<Entity> loopents1 = new List<Entity> { new Circle(new Point3d(0, 0, 0), Vector3d.ZAxis, 1.5) };
ObjectIdCollection loopids1 = new ObjectIdCollection(loopents1.Select(ent => AddEntity(tr, blkdef, ent)).ToArray());
Hatch acHatch = new Hatch();
acHatch.SetDatabaseDefaults();
acHatch.HatchObjectType = HatchObjectType.GradientObject;
acHatch.SetGradient(GradientPatternType.PreDefinedGradient, "SPHERICAL");
// We're defining two colours
acHatch.GradientOneColorMode = false;
GradientColor[] gcs = new GradientColor;
gcs = new GradientColor(Color.FromRgb(213, 213, 210), 0);
gcs = new GradientColor(Color.FromRgb(255, 255, 255), 1);
acHatch.SetGradientColors(gcs);
acHatch.Elevation = 0;
acHatch.Associative = false;
acHatch.HatchStyle = HatchStyle.Outer;
acHatch.AppendLoop(HatchLoopTypes.Outermost, loopids);
acHatch.AppendLoop(HatchLoopTypes.Default, loopids1);
acHatch.EvaluateHatch(true);
//loopents.ForEach(ent => ent.Erase());
List<Entity> ents = new List<Entity> { new Circle(Point3d.Origin, Vector3d.ZAxis, 10), new Line(new Point3d(-15, 0, 0), new Point3d(15, 0, 0)), acHatch };
int i = 1;
ents.ForEach(ent => { ent.ColorIndex = i++; AddEntity(tr, blkdef, ent); });
页:
1
[2]