Revit API取得全部元素
//取得全部元素
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class cmdGetAll : IExternalCommand
{
public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elements)
{
UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
//全部元素
FilteredElementCollector collectorAll = new FilteredElementCollector(uiDoc.Document);
collectorAll.WherePasses(new LogicalOrFilter(new ElementIsElementTypeFilter(false), new ElementIsElementTypeFilter(true)));
TaskDialog.Show("全部", collectorAll.Count().ToString());
//IsElement
FilteredElementCollector collectorIs = new FilteredElementCollector(uiDoc.Document);
collectorIs.WherePasses(new ElementIsElementTypeFilter(true));
TaskDialog.Show("IsElement", collectorIs.Count().ToString());
//IsNotElement
FilteredElementCollector collectorIsNot = new FilteredElementCollector(uiDoc.Document);
collectorIsNot.WherePasses(new ElementIsElementTypeFilter(false));
TaskDialog.Show("IsNotElement", collectorIsNot.Count().ToString()); //数量
int ductAll = ;
int ductIs = ;
int ductIsNot = ;
foreach (Element el in collectorAll)
{
if (el is Duct)
ductAll += ;
}
foreach (Element el in collectorIs)
{
if (el is Duct)
ductIs += ;
}
foreach (Element el in collectorIsNot)
{
if (el is Duct)
ductIsNot += ;
}
TaskDialog.Show("duct", ductAll + "," + ductIs + "," + ductIsNot); return Result.Succeeded;
}
}
url:http://greatverve.cnblogs.com/p/get-all-element.html
Revit API取得全部元素的更多相关文章
- Revit API射线法读取空间中相交的元素
Revit API提供根据射线来寻找经过的元素.方法是固定模式,没什么好说.关键代码:doc.FindReferencesWithContextByDirection(ptStart, (ptEnd ...
- 【Revit API】梁构件支座检查算法
一.前言 应该是第二次写关于Revit API的博文了.虽然在BIM企业中工作,从事桌面BIM软件开发,但是我是不怎么喜欢写Revit API相关的代码.平时更多的是在写界面展示,架构 ...
- Revit API 判断一个构件在某个视图中的可见性
查看 Revit API.发现有Element::IsHidden这个方法.通过UI创建一个element,注意要使得这个element在某些视图可见,但是在另一些视图不可见.运行下面的方法,你会发现 ...
- Revit API 操作共享参数和项目参数
1.获取共享参数 private string GetSharInfo(Autodesk.Revit.ApplicationServices.Application revitApp) { Strin ...
- Revit API 加载族并生成实例图元
在Revit API中加载族可以使用Doc.LoadFamily方法,传入要加载的族文件路径名,但是这种方式有一种缺点,就是如果族文件在当前工程中没有加载的话则返回成功,如果已经加载过,则返回失败,也 ...
- Selenium 安装与配置及webdriver的API与定位元素
1. selenium安装命令行 C:\Users\wu>cd /d E:\soft\python3.6\Scripts E:\soft\python3.6\Scripts>pip3 in ...
- 关于Revit API修改元素参数的问题?
>ADN: DEVR3894 >ADN service level: Professional >产品:Revit MEP 2012 >版本:2012 >语言:中 ...
- Revit API封装一个通用函数“过名称找元素”
感觉这个函数不错.通过这种方式寻找元素经常需要用到. ) { ]; } // cannot find it. return null; ...
- Revit API创建几何实体Solid并找到与之相交的元素
几何实体的创建方法之一:构成封闭底面,指定拉伸方向与拉伸高度.GeometryCreationUtilities ; , pt.Y - dBoxLength / , pt.Z); ...
随机推荐
- Saving Tang Monk II
题目链接:http://hihocoder.com/contest/acmicpc2018beijingonline/problem/1 AC代码: #include<bits/stdc++.h ...
- atom使用markdown
atom使用markdown 最近因为不喜欢博客园自身带的编辑工具,所以尝试使用markdown,目前只是想简单的把标题和内容分的开一些,以后在慢慢熟悉吧 1.atom上安装markdown 在没有外 ...
- 搭建RabbitMQ集群(Docker)
前一篇搭建RabbitMQ集群(通用)只是把笔记直接移动过来了,因为我的机器硬盘已经满了,实在是开不了那么虚拟机. 还好,我的Linux中安装了Docker,这篇文章就简单介绍一下Docker中搭建R ...
- 有用的Python模块 - pprint
当想在终端打印一个很大的字典或者一个很长的列表时,总是被print打印出来的效果气懵在电脑前,现在有pprint就不用担心啦. 最直接的使用方式就是 import pprint pprint.ppri ...
- python日常
1.远程访问远程访问Jupyter Notebook,本地浏览器不能打开,先查了防火墙的状态,然后将设置的端口进行allow,网址,仍然拒绝链接,而后通过远程访问Jupyter Notebook,然后 ...
- ExpressMapper- The New .NET Mapper!
推荐,据测试比手工映射的效率还高. https://www.codeproject.com/Tips/1009198/Expressmapper-The-New-NET-Mapper
- elasticflow
https://github.com/robcowart/elastiflow/blob/master/INSTALL.md
- 【LOJ】#6433. 「PKUSC2018」最大前缀和
题解 神仙的状压啊QAQ 设一个\(f[S]\)表示数字的集合为\(S\)时\(sum[S]\)为前缀最大值的方案数 \(g[S]\)表示数字集合为\(S\)时所有前缀和都小于等于0的方案数 答案就是 ...
- Vue $createElement
const h=this.$createElement; h('span', tag, '内容可以是 ') ..... tag完整的数据对象如下: { // 和`v-bind:class`一样的 ...
- 介绍activity文档翻译
原文链接:https://developer.android.google.cn/guide/components/activities/intro-activitiesSS 一, 对activit的 ...