在Revit 2014里面,调用NewSlab方法抛出一个奇怪的错误:
Boundary edge lines intersect each other. Boundary contour must not be distorted.
中文是这样:
边界边缘线彼此相交。边界等高线不可扭曲。
下面是他的代码:
CurveArray temCurveArr = new CurveArray();
temCurveArr.Append(Line.CreateBound(
new XYZ(74.442251711, 9.432414698, 9.842519685),
new XYZ(74.442251711, 6.889763780, 9.842519685)));
temCurveArr.Append(Line.CreateBound(
new XYZ(74.442251711, 6.889763780, 9.842519685),
new XYZ(72.539370079, 6.889763780, 9.842519685)));
temCurveArr.Append(Line.CreateBound(
new XYZ(72.539370079, 6.889763780, 9.842519685),
new XYZ(72.539370079, 9.268372703, 9.842519685)));
temCurveArr.Append(Line.CreateBound(
new XYZ(72.539370079, 9.268372703, 9.842519685),
new XYZ(73.523622047, 9.268372703, 9.842519685)));
temCurveArr.Append(Line.CreateBound(
new XYZ(73.523622047, 9.268372703, 9.842519685),
new XYZ(73.523622047, 9.432414698, 9.842519685)));
temCurveArr.Append(Line.CreateBound(
new XYZ(73.523622047, 9.432414698, 9.842519685),
new XYZ(74.442251711, 9.432414698, 9.842519685)));
Line banSlopArrowLine = Line.CreateBound(
new XYZ(74.442251711, 6.151574803, 9.842519685),
new XYZ(74.442251711, 9.432414698, 9.842519685));
slab = RevitDoc.Create.NewSlab(
temCurveArr, RevitDoc.ActiveView.GenLevel,
banSlopArrowLine, 0, true);
这段代码在Revit 2015里面是可以正常工作的,奇怪的是在2014里面就是无法成功。
我研究了半天,发现删掉其中一个东西之后,该板才得以创建,但这总归不是一个解决办法。
在咨询了开发部之后,我的同事Andrzej给出了一个办法:
1. 板的”结构“属性不要勾选,或者
2. 板的”启用分析模型“不要勾选
对应的,我们可以再创建Slab之后,马上调用下面的任何一段代码:
1.slab.get_Parameter(BuiltInParameter.STRUCTURAL_ANALYTICAL_MODEL).Set(0);
2.slab.get_Parameter(BuiltInParameter.FLOOR_PARAM_IS_STRUCTURAL).Set(0);
如果不需要分析模型,请使用方法2,如果既不需要分析模型又不需要钢筋,请使用方法1.