当前位置: 首页 > news >正文

iis7发布网站教程论坛推广方案

iis7发布网站教程,论坛推广方案,请收网址999938,成品ppt的网站免费直播有哪些前言 Revit 有一套完整的几何造型能力,每一个体量都是一个GenericForm,这些体量可以通过拉伸、扫掠等创建。这个例子介绍如何将他们合并成一个体量。 内容 合并体量的关键接口: // Autodesk.Revit.DB.Document public GeomCombination Com…

前言

Revit 有一套完整的几何造型能力,每一个体量都是一个GenericForm,这些体量可以通过拉伸、扫掠等创建。这个例子介绍如何将他们合并成一个体量。

内容

在这里插入图片描述
合并体量的关键接口:

// Autodesk.Revit.DB.Document
public GeomCombination CombineElements(CombinableElementArray members);

可以合并的实体,相关类的集成体系:
在这里插入图片描述
如何通过UI创建各种类型的实体,可以参考 Revit 官方文档:创建实心形状

case 1:手动选中了一些元素

核心逻辑:

  1. 遍历所有选中元素
  2. 确保元素是GenericForm,且是实体solid
  3. 确保都是 CombinableElementGenericForm集成自CombinableElement,这步有点多余)
  4. 合并符合条件的元素: doc.Document.CombineElements(solids)

核心代码:

// 遍历所有选中元素
foreach (Autodesk.Revit.DB.ElementId elementId in doc.Selection.GetElementIds())
{Autodesk.Revit.DB.Element element = doc.Document.GetElement(elementId);// 确保元素是`GenericForm`,且是实体solidGenericForm gf = element as GenericForm;if (null != gf && !gf.IsSolid)continue;// 确保都是 `CombinableElement` (`GenericForm`集成自`CombinableElement`,这步有点多余)CombinableElement ce = element as CombinableElement;if (null != ce)solids.Append(ce);
}
// 合并符合条件的元素
doc.Document.CombineElements(solids);

case 2:没有选中,则处理整个文档

核心逻辑:

  1. 过滤出所有的GenericFormGeomCombination
  2. 遍历过滤元素
  3. 确保元素是GenericForm,且是实体solid
  4. 确保都是 CombinableElementGenericForm集成自CombinableElement,这步有点多余)
  5. 对有重叠的元素进行几何合并:JoinOverlapping,判断是否重叠的逻辑在 IsOverlapped

核心代码:

// 过滤出所有的`GenericForm`和`GeomCombination`
LogicalOrFilter filter = new LogicalOrFilter(new ElementClassFilter(typeof(GenericForm)), new ElementClassFilter(typeof(GeomCombination)));
// 遍历过滤元素
FilteredElementIterator itor = (new FilteredElementCollector(document)).WherePasses(filter).GetElementIterator();
itor.Reset();
while (itor.MoveNext()){// 确保元素是`GenericForm`,且是实体solidGenericForm gf = itor.Current as GenericForm;if (null != gf && !gf.IsSolid)continue;// 确保都是 `CombinableElement` (`GenericForm`集成自`CombinableElement`,这步有点多余)CombinableElement ce = itor.Current as CombinableElement;if (null == ce)continue;m_elements.Add(ce);
}
// 对有重叠的元素进行几何合并
GeomCombination geomCombination = JoinOverlapping(m_elements, document);

JoinOverlapping 的核心逻辑在于判断是否重叠的逻辑, IsOverlapped

  1. 获取元素几何,GeometryElement get_Geometry(Options options)
  2. 获取GeometryObject所有Face
    类型是 Solid,通过接口 solid.Faces
    类型是 GeometryElement, 通过 GetEnumerator 接口递归调用
  3. 获取所有的线 GetAllCurves
    首先获取所有的 Face,通过 face.EdgeLoops 获取线的几何信息
  4. 判断线和面是否相交

部分核心代码:

// 获取元素几何
Options geOptions = Command.s_appCreation.NewGeometryOptions();
elementA.get_Geometry(geOptions);// 获取所有的 Face,需要递归调用
private static void GetAllFaces(GeometryElement geoElement, List<Face> faces){IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();while (Objects.MoveNext()){GeometryObject geObject = Objects.Current;GetAllFaces(geObject, faces);}
}
private static void GetAllFaces(Solid solid, List<Face> faces){foreach (Face face in solid.Faces){faces.Add(face);}
}
private static void GetAllFaces(GeometryObject geometry, List<Face> faces){if (geometry is GeometryElement){GetAllFaces(geometry as GeometryElement, faces);return;
}if (geometry is Solid){GetAllFaces(geometry as Solid, faces);return;}
}// 获取所有的 curve,类似,省略

其它

这个 sample 代码质量有些混乱,需自行整理分析。

http://www.hkea.cn/news/971801/

相关文章:

  • 广州中新知识城开发建设网站无锡百姓网推广
  • 宝鸡做网站费用关键词你们懂的
  • wordpress 仿站 教程百度竞价点击一次多少钱
  • 做h的游戏 迅雷下载网站百度推广管家
  • 营销型网站建设的目的外贸网站平台都有哪些 免费的
  • 广东做网站公司广州从化发布
  • 能发外链的网站国际新闻今天最新消息
  • 做软件的网站关键词优化快速排名
  • 网站建设与管理简介网站链接交易
  • 英文网站建设教程网盘资源搜索神器
  • 做旅游网站的引言最新网络推广平台
  • 服务器上给网站做301跳转企业网站注册
  • 网站建设好做吗乐事薯片软文推广
  • wordpress 年月归档如何优化培训体系
  • 威海高区建设局网站长春做网络优化的公司
  • 安平做网站百度一下首页百度一下知道
  • 苏州建设网站市政中标项目如何做推广引流赚钱
  • 17网站一起做网店怎么下单来宾网站seo
  • 建设商务网站的目的天津seo网站排名优化公司
  • 阿里巴巴网站导航栏怎么做口碑营销策划方案
  • 线上做交互的网站百度app下载
  • 做暖暖欧美网站挖掘爱站网
  • 网站 风格百度推广公司
  • 林州网站建设公司站长工具关键词排名怎么查
  • 想给公司做个网站微信seo是什么意思
  • 网站做管制户外刀具营销推广方案模板
  • 淘宝客网站免费做seo网站关键词优化机构
  • 企业做网站建设的好处seo网站关键词优化
  • 一般网站用什么做的最新新闻国内大事件
  • 做线上网站需要钱吗互联网营销推广