Revit API创建墙的保温层修改墙厚度
start
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class cmd : IExternalCommand
{
public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elements)
{
UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
Document doc = uiDoc.Document; Transaction ts = new Transaction(uiDoc.Document, "http://revit.5d6d.com");
ts.Start(); Wall wall = uiDoc.Document.GetElement(uiDoc.Selection.PickObject(ObjectType.Element, "wall")) as Wall;
//取得一种材质
Materials materials = doc.Settings.Materials;
ElementId materialId = materials.get_Item("隔热层/保温层 - 空心填充").Id;
//得到墙结果
CompoundStructure cs = wall.WallType.GetCompoundStructure();
//ElementId matId = Material.Create(doc, "MyMaterial");//创建材质
//创建保温层(厚度,功能,材质)
CompoundStructureLayer layer = new CompoundStructureLayer( / 304.8, MaterialFunctionAssignment.Insulation, materialId);
cs.SetLayer(cs.GetFirstCoreLayerIndex(), layer);
//修改墙体厚度
IList<CompoundStructureLayer> listLayer = cs.GetLayers();
int iIdx = ;
foreach (CompoundStructureLayer cLayer in listLayer)
{
if (MaterialFunctionAssignment.Structure == cLayer.Function)
{
break;
}
iIdx += ;
}
cs.SetLayerWidth(iIdx, / 304.8);
//调用更新
wall.WallType.SetCompoundStructure(cs); ts.Commit(); return Result.Succeeded;
}
}
url:http://greatverve.cnblogs.com/p/revit-api-CompoundStructure.html
Revit API创建墙的保温层修改墙厚度的更多相关文章
- Revit API创建几何实体Solid并找到与之相交的元素
几何实体的创建方法之一:构成封闭底面,指定拉伸方向与拉伸高度.GeometryCreationUtilities ; , pt.Y - dBoxLength / , pt.Z); ...
- Revit API创建一个拷贝房间内对象布局命令
本课程演示创建一个拷贝房间内对象布局命令,完整演示步骤和代码.这个命令把选中房间内的对象复制到其它选中的一个或多个房间中,而且保持与源房间一致的相对位置.通过本讲座使听众知道创建一个二次开发程序很简单 ...
- Revit API创建标注NewTag
start ; ) { eId = item; } ...
- Revit api 创建族并加载到当前项目
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Revit API创建标高,单位转换
一业内朋友让我写个快速创建标高的插件. ; ; i <= iNum; i++) { Level level = d ...
- Revit API 创建带箭头的标注
[Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] public class cmd : ...
- Revit api 创建楼梯图元
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Revit API创建详图视图
start //创建详图视图 Transaction ts = new Transaction(doc, "http://greatverve.cnblogs.com"); ts. ...
- revit API 生成墙图元
由于Revit的版本问题,在网上找的生成墙图元的代码,在我机器上的Revit 2016中编译不能通过,通过多次调试,终于找到在revit 2016中使用API生成墙图元的代码,现在贴出来. 下面的代码 ...
随机推荐
- weblogica
- PHP URL中包含中文,查看时提示404
使用Microsoft Web Platform在IIS里配置安装一个wordpress,一切顺利. 当添加一片文章时,自动生成URL类似如下: http://localhost/wordpress/ ...
- 关于iTerm2中颜色配置及快捷键使用技巧(亲测)
https://github.com/mbadolato/iTerm2-Color-Schemes http://chriskempson.com/projects/base16 (同事用的) 按照g ...
- 虚拟机Failed to start LSB: Bring up/down networking
1.执行 service network restart 出现以下错误 Restarting network (via systemctl): Job for network.service f ...
- java 异常 throw
throw UnsupportedOperationException(); //没有支持的操作NoSuchElementException(); //没有这样的元素
- kafka查看消费数据
一.如何查看 在老版本中,使用kafka-run-class.sh 脚本进行查看.但是对于最新版本,kafka-run-class.sh 已经不能使用,必须使用另外一个脚本才行,它就是kafka-co ...
- js 获取json对象的Key、value(js遍历json对象的key和value)
<script type="text/javascript"> getJson('age'); function getJson(key){ "," ...
- SqlServer中 SET DATEFIRST更改
在 SQL Server 中默认情况下,每周的开始都是从周日开始算起的,如果默认星期一呢? 这里有三种方式可以解决这个问题: 一:直接通过 SET DATEFIRST VALUE 来更改重新生成新的 ...
- element-ui 日期选择范围限制,只允许选择上下浮动一个月内的日期
<el-date-picker class="filter-item" type="daterange" value-format="yyyy- ...
- 【LOJ】#2512. 「BJOI2018」链上二次求和
题面 题解 转化一下可以变成所有小于等于r的减去小于等于l - 1的 然后我们求小于等于x的 显然是 \(\sum_{i = 1}^{n} \sum_{j = 1}^{min(i,x)} sum[i] ...