RevitAPI: 调用NewExtrusion的时候抛出异常 One of the conditions for the inputs was not satisfied
来源:互联网 发布:java的反射 编辑:程序博客网 时间:2024/05/16 05:04
当调用Document.FamilyCreate.NewExtrusion的时候,可能会抛出下面的异常
Autodesk.Revit.Exceptions.ArgumentException: One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument.这个很有可能是因为您传入的profile和normal不垂直,也就是形状和拉伸方向不垂直。
例如自己的代码可能是这么写的:
// Create a rectangle profileCurveArrArray profile = new CurveArrArray();CurveArray ca = new CurveArray();XYZ[] points = new XYZ[] { new XYZ(10, 0, 0), new XYZ(20, 0, 0), new XYZ(20, 0, 10), new XYZ(10, 0, 10)};for (int ii = 0; ii < points.Length; ii++){ var point = points[ii]; var point2 = points[ii == points.Length - 1 ? 0 : ii + 1]; ca.Append(Line.CreateBound(point, point2));}profile.Append(ca);// create the plane normal is perpendicular with profileSketchPlane sketchplane = SketchPlane.Create(doc, new Plane(XYZ.BasisZ, XYZ.Zero));Extrusion solid = doc.FamilyCreate.NewExtrusion( true, profile, sketchplane, 20);
实际上注意到SketchPlane的normal是向上的也就是和Z轴垂直,而profile和Y轴垂直,
所以,创建SketchPlane的代码应该是这样的:
SketchPlane sketchplane = SketchPlane.Create(doc, new Plane(XYZ.BasisY, XYZ.Zero));
0 0
- RevitAPI: 调用NewExtrusion的时候抛出异常 One of the conditions for the inputs was not satisfied
- RevitAPI: Revit 2016调用NewFamilyIntance的时候抛出异常The symbol is not active
- DLL调用异常:The value of ESP was not properly......
- Maven抛出异常repository element was not specified in the POM inside distributionManagement element
- RevitAPI: Rebar.CreateFromCurves抛出异常: Unable to create a RebarShape based on the given curves
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present
- 抛出nib but the view outlet was not set
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present in the select list
- Install Hotfix for WSS(KB974989 x86) ERROR:The expected version of the product was not found on the system
- WebService调用时的异常:Not enough message parts were received for the operation
- DLL 调用错误 -The value of ESP was not properly saved across a function call.
- dynamic DLL 调用错误 -The value of ESP was not properly saved across a function call
- DLL 调用错误 -The value of ESP was not properly saved across a function call.
- DLL 调用错误 -The value of ESP was not properly saved across a function cal
- 解决yum升级的问题“There was a problem importing one of the Python modules”
- xilinx "ERROR:EDK - intc () - Internal error: Num intr inputs 1 not the same as length of ..."解决
- 关于JSP文件运行时抛出The value for the useBean class attribute XXX is invalid异常的分析
- One of the MulticastTest
- 功能测试
- 寄存器中cs,ds,ss,es的区别
- Oracle中的日期和字符串互相转换
- GetClientRect
- SQL截取字符串
- RevitAPI: 调用NewExtrusion的时候抛出异常 One of the conditions for the inputs was not satisfied
- gre考试是机考还是笔试?
- android悬浮窗口的实现
- python 的 subprocess模块
- hdu 2066
- 立体类族共有的抽象类
- 根据日期如何得出该日期是星期几
- Sql日期时间格式转换
- poj2346--Lucky tickets+DP