Revit+对象空间的关系
来源:互联网 发布:gvim python 编辑:程序博客网 时间:2024/06/03 13:35
UIApplication app = commandData.Application; Document doc = app.ActiveUIDocument.Document; Transaction trans = new Transaction(doc, "ExComm"); trans.Start(); Selection sel = app.ActiveUIDocument.Selection; Reference ref1 = sel.PickObject(ObjectType.Element, "Please pick a beam"); FamilyInstance beam = doc.GetElement(ref1) as FamilyInstance; //Read the beam's location line LocationCurve lc = beam.Location as LocationCurve; Curve curve = lc.Curve; XYZ ptStart = curve.get_EndPoint(0); XYZ ptEnd = curve.get_EndPoint(1); //move the two point a little bit lower, so the ray can go through the wall XYZ offset = new XYZ(0, 0, 0.01); ptStart = ptStart - offset; ptEnd = ptEnd - offset; View3D view3d = null; view3d = doc.ActiveView as View3D; if (view3d == null) { TaskDialog.Show("3D view", "current view should be 3D view"); return Result.Failed; } double beamLen = curve.Length; IList<ReferenceWithContext> references = doc.FindReferencesWithContextByDirection(ptStart, (ptEnd - ptStart), view3d); //ElementSet wallSet = app.Application.Create.NewElementSet(); sel.Elements.Clear(); double tolerate = 0.00001; foreach (ReferenceWithContext reference in references) { Reference ref2 = reference.GetReference(); ElementId id = ref2.ElementId; Element elem = doc.get_Element(id); if (elem is Wall) { if (reference.Proximity < (beamLen + tolerate)) { sel.Elements.Add(elem); } } } trans.Commit(); return Result.Succeeded;
0 0
- Revit+对象空间的关系
- Building Coder(Revit 二次开发) - 对象关系
- 正在预备Revit几何属性访问以及对象间关系的专题讲座
- 如何获取Revit工作集中的对象?
- 拷贝Revit中的对象的诀窍,顺论Revit中对象的拷贝
- Revit二次开发高级专题讲座:访问Revit模型中的几何数据以及对象间关系判断方法(点击下载)
- Revit二次开发--过滤对象
- Revit+对象高效过滤
- 如何编程创建Revit里面的视图过滤器对象
- 如何用Revit API从无到有创建构建的类型对象?
- 详谈用API读取Revit对象的参数值
- Revit 二次开发---空间过滤(空间查询)
- 图像的空间关系特征
- 空间与物体的关系
- oracle中的数据库、用户、方案、表空间、表对象之间的关系
- oracle中的数据库、用户、方案、表空间、表对象之间的关系 .
- oracle学习之路--数据库实例、方案、用户、表空间、表对象之间的关系
- oracle中的数据库、用户、方案、表空间、表对象之间的关系
- offsetWidth与margin padding的影响
- 方法区和运行时常量池溢出
- SeaJS入门
- Uva 11582(Fibonacci循环节)
- 刻录光盘工具
- Revit+对象空间的关系
- 基于多租户的云计算Overlay网络
- webpack 模块加载兼打包工具——入门或进阶
- Android RecyclerView实现多布局切换功能从导入到运行详解,,上方图片轮播,下方多布局加载
- PAT 1090. Highest Price in Supply Chain (25)(求叶节点的最高层数,bfs)
- HDU 1532 - Drainage Ditches
- 安全退出多个activity
- YUV编码为HEVC(H.265)
- 内存管理:03高端内存简介