- 积分
- 213
- 明经币
- 个
- 注册时间
- 2010-6-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
用C#做的开发,在对多线段封闭的矩形进行填充时,填充比例不变时(如为0.5),当长宽超过一定值时,会出现“填充图案太密”的错误提示!请问这种情况应该怎么处理呢?
填充比例不能改变的!
/// <summary>
/// 图形填充测试
/// </summary>
private void Hatch()
{
string path = Application.StartupPath;
aDocument.Application.Preferences.Files.SupportPath += ";" + path;
IAcadHatch hatch = aDocument.ModelSpace.AddHatch((int)AcPatternType.acHatchPatternTypeUserDefined, "gksy", true, AcHatchObjectType.acHatchObject);
double XPoint = (double)nudXPoint.Value;
double YPoint = (double)nudYPoint.Value;
double height = (double)nudLength.Value;
double width = (double)nudWidth.Value;
double scale = (double)nudScale.Value;
//矩形封闭区域
AcadLWPolyline line = aDocument.ModelSpace.AddLightWeightPolyline(
new double[] { XPoint, YPoint,
XPoint, YPoint + height,
XPoint + width, YPoint + height,
XPoint + width, YPoint });
//封闭多段线
line.Closed = true;
AcadEntity[] array = new AcadEntity[] { line as AcadEntity };
hatch.AppendOuterLoop(array);
hatch.PatternScale = scale;
//显示填充图案
try
{
hatch.Evaluate();
lblMessage.Text = "生成完成!";
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
lblMessage.Visible = true;
}
|
|