当前位置:网站首页>Revit secondary development - modify wall thickness
Revit secondary development - modify wall thickness
2022-07-07 22:22:00 【Hey, hey, hey, hey, hey】
The wall thickness is read-only , Can't modify , So we can only modify the layer thickness of its internal structure .
1、 Get the wall structure
2、 Get all layers , And traverse and modify the thickness
3、 The modified layer set is set to the structure , And set the structure to the wall type
The approximate code is as follows :
Wall wall;
double dThickness = 500 / 304.8;
double dHeight = wall.get_Prarmeter(BuiltInParameter.WALL_USER_HEIGHT_PARAM).AsDouble();
double dOffset = wall.get_Parameter(BuiltInParameter.WALL_BASE_OFFSET).AsDouble();
LocationCurve lc = wall.Location as LocationCurve;
Curve curve = lc.Curve;
using(Transaction trans = new Transaction(doc,"edit"))
{
trans.Start();
try
{
// Thickness type attribute , It is suggested to create a new wall type
WallType newType = wall.WallType.Duplicate("NewWallType") as WallType;
CompoundStructure cs = newType.GetCompoundStrycture();
// Get all layers
IList<CompoundStructureLayer> lstLayers = cs.GetLayers();
foreach(CompoundStructureLayer item in lstLayers)
{
if(item.Function == MaterialFunctionAssignment.Structure)
{// Only one structural layer is considered here , If there are more than one, calculate by yourself
item.Width = dThickness;
break;
}
}
// Set it again after modification
cs.SetLayers(lstLayers);
newType.SetCompoundStructure(cs);
Wall.Create(doc,curve,newType.Id,wall.LevelId,dHeight,dOffset,false,false);
doc.Delete(wall.Id);
trans.Commit();
}
catch
{
trans.RollBack();
}
}
边栏推荐
- Write in front -- Talking about program development
- Kirin Xin'an operating system derivative solution | storage multipath management system, effectively improving the reliability of data transmission
- 客户案例|华律网,通过观测云大幅缩短故障定位时间
- Implementation method of data platform landing
- Remember an experience of using selectmany
- SAR影像质量评估
- Pre sale 179000, hengchi 5 can fire? Product power online depends on how it is sold
- Have you ever been confused? Once a test / development programmer, ignorant gadget C bird upgrade
- EasyCVR配置中心录像计划页面调整分辨率时的显示优化
- Remember aximp once Use of exe tool
猜你喜欢
Firefox browser installation impression notes clipping
Blender exchange group, welcome to the water group ~
Implementation method of data platform landing
[开源] .Net ORM 访问 Firebird 数据库
ByteDance Android interview, summary of knowledge points + analysis of interview questions
How to realize the movement control of characters in horizontal game
L2: current situation, prospects and pain points of ZK Rollup
PDF文档签名指南
Kirin Xin'an operating system derivative solution | storage multipath management system, effectively improving the reliability of data transmission
Customer case | China law network, through observing the cloud, greatly shortens the time of fault location
随机推荐
Typescript TS basic knowledge type declaration
OpenGL homework - Hello, triangle
Relationship between URL and URI
UWA问答精选
Crawler (17) - Interview (2) | crawler interview question bank
Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda
How to make agile digital transformation strategy for manufacturing enterprises
npm uninstall和rm直接删除的区别
Paint basic graphics with custompaint
The essence of analog Servlet
Redis - basic use (key, string, list, set, Zset, hash, geo, bitmap, hyperloglog, transaction)
NVR硬盘录像机通过国标GB28181协议接入EasyCVR,设备通道信息不显示是什么原因?
. Net automapper use
怎样写一个增广矩阵到txt文件中
L2: current situation, prospects and pain points of ZK Rollup
How does win11 unblock the keyboard? Method of unlocking keyboard in win11
How polardb-x does distributed database hotspot analysis
How does win11 time display the day of the week? How does win11 display the day of the week today?
null == undefined
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525