Revit Family API 找到实体某一方向上的面。
// helper function: given a solid, find a planar
//Extrusion实体,给一个实体,给一个方向,找到与此方向一致的面。
// face with the given normal (version 2)
// this is a slightly enhaced version of the previous
// version and checks if the face is on the given reference plane.
// ===============================================================
PlanarFace findFace(Application app, Extrusion pBox, XYZ normal, ReferencePlane refPlane)
{
// get the geometry object of the given element
//
Options op = new Options();
op.ComputeReferences = true;
GeometryObjectArray geomObjs = pBox.get_Geometry(op).Objects;
// loop through the array and find a face with the given normal
//
foreach (GeometryObject geomObj in geomObjs)
{
if (geomObj is Solid) // solid is what we are interested in.
{
Solid pSolid = geomObj as Solid;
FaceArray faces = pSolid.Faces;
foreach (Face pFace in faces)
{
PlanarFace pPlanarFace = (PlanarFace)pFace;
// check to see if they have same normal
//face.Normal是面的向量。IsAlmostEqualTo();
if ((pPlanarFace != null) && pPlanarFace.Normal.IsAlmostEqualTo(normal))
{
// additionally, we want to check if the face is on the reference plane
//还要判断面是否在参考平面上。
XYZ p0 = refPlane.BubbleEnd;//终点?
XYZ p1 = refPlane.FreeEnd;//起点?
Line pCurve = app.Create.NewLineBound(p0, p1);
if (pPlanarFace.Intersect(pCurve) == SetComparisonResult.Subset)//子集
{
return pPlanarFace; // we found the face
}
}
}
}
// will come back later as needed.
//
//else if (geomObj is Instance)
//{
//}
//else if (geomObj is Curve)
//{
//}
//else if (geomObj is Mesh)
//{
//}
}
// if we come here, we did not find any.
return null;
}
url:http://greatverve.cnblogs.com/p/revit-family-api-find-face.html
Revit Family API 找到实体某一方向上的面。相关推荐
- Revit Family API 添加几何实体
先创建一个封闭曲线createProfileLShape(); 再创建实体,这里需要手工画一个参考平面Reference Plane: [TransactionAttribute(Autodesk.R ...
- Revit 2015 API 的所有变化和新功能
这里从SDK的文章中摘录出所有的API变化.主要是希望用户用搜索引擎时能找到相关信息: Major changes and renovations to the Revit API APIchange ...
- Revit Family API 添加参数与尺寸标注
使用FamilyManager其他的与普通添加参数与标注没区别. [TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Man ...
- 使用 ASP.NET Core Razor 页、Web API 和实体框架进行分页和排序
目录 核心类 数据层 The API Razor页面 如何使用 .NET Core Razor 页.Web API 和实体框架实现分页和排序,以产生良好的性能. 该项目的特点是: 选择页面大小(Pag ...
- Revit 2014 发布, Revit 2014 API新功能
Revit 2014 SDK 下载地址: http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975 Major c ...
- 利用免费API找到手机归属地
这里写自定义目录标题 import requests url = "https://www.iteblog.com/api/mobile.php?mobile=XXXXXX" hd ...
- SpringBoot整合Mybatis未打成jar正常运行,打成jar包,TypeAliases配置失败致使mybatis无法找到实体类的问题
请看这里:https://www.cnblogs.com/Franken-Fran/p/mybatis_typeAliase_error.html
- 利用ovito计算某一方向上(例如x方向)上某一种原子的原子密度
打开ovito-->导入文件-->add modifucation选择Select type(选择需要分析的原子类型)-->add modification下选择Histogram- ...
- kd-tree : k近邻查询和范围查询
作者:DylanFrank(滔滔) 转载请注明出处 http://blog.csdn.net/dylan_frank/article/details/77934272 想象一下我们有如下两个任务: 我 ...
最新文章
- Ubuntu SVN安装使用命令
- xampp mysql.sock_解决xampp自启动和mysql.sock问题
- python绘制三维地形shade(vert_exag)参数_Python的地形三维可视化Matplotlib和gdal使用实例...
- Vue el-menu高亮设置及点击菜单项实现路由跳转
- p服务器不响应,无法加载资源:服务器响应状态为500
- 华为怎么改输入法皮肤_微信和QQ个性键盘皮肤
- 使用Server 2008新GPO做驱动器映射
- xunit-ICollectionFixture
- 【图精】徐克镜头里的十大美人
- 怎么调用新建模型里文章的内容_读完这篇文章,再难的建筑模型你都能快速上手...
- semantic ui中文文档_一起学Vue:UI框架(element-ui)
- 3dmax导出fbx没有贴图_实例讲解ArcGIS 与 3DMax 结合建模
- Anylogic学习--------------三维窗口
- 程序员如何一键批量下载Iconfont图标
- JN5169 Bootload 烧录过程和DIY烧录程序(一)
- redis分布式锁实现(以抢红包为例)
- 学界 | Ian Goodfellow最新论文:是猫还是狗?不光神经网络识别不了,你也能被忽悠...
- 如何用nginx部署静态网站
- Ubuntu系统软链接的建立与删除
- NVM安装nodejs的方法