- 积分
- 292
- 明经币
- 个
- 注册时间
- 2012-7-27
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2012-10-15 16:54:04
|
显示全部楼层
雪山飞狐_lzh 发表于 2010-12-8 13:52
狐哥,我想定义填充色的边界,即一个外边界,一个内边界,为什么这样填充没有效果啊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[2];
gcs[0] = new GradientColor(Color.FromRgb(213, 213, 210), 0);
gcs[1] = 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); }); |
|