当前位置:网站首页>Revit secondary development - operation family documents
Revit secondary development - operation family documents
2022-07-07 22:22:00 【Hey, hey, hey, hey, hey】
note
// Open the family document through the family file path
Document fDoc = doc.Application.OpenDocumentFile(@"d:\xxx.rfa");
// Open the family document directly from the project
Document fDoc = doc.EditFamily(family);
// Get the family document FamilyManager
FamilyManager fm = fDoc.FamilyManager;
// Switch family types
using(Transaction trans = new Transaction(fDoc,"changeType"))
{
trans.Start();
foreach(FamilyType ft in fm.Types)
{
if(ft.Name == " type 2")
{
fm.CurrentType = ft;
break;
}
}
}
// Get family parameters
FamilyParameter fParameter = fm.get_Parameter(" Parameter name ");
// Get parameter value
double fValue = fm.CurrentType.AsDouble(fParameter).Value;
// Get parameter formula
string formula = fParameter.Formula;
// The modification should be in the transaction
// Modify parameter value
fm.Set(fParameter,10.5);
// Modify parameter formula
fm.Set(fParameter," Long * wide ");
// Add parameter
fm.AddParameter(" Custom parameters ",BuiltInParameterGroup.PG_GENERAL,ParameterType.Integer,true);
边栏推荐
- ByteDance senior engineer interview, easy to get started, fluent
- 双塔模型的最强出装,谷歌又开始玩起“老古董”了?
- EasyCVR配置中心录像计划页面调整分辨率时的显示优化
- Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
- How to write an augmented matrix into TXT file
- The whole network "chases" Zhong Xuegao
- 三元表达式、各生成式、匿名函数
- Pre sale 179000, hengchi 5 can fire? Product power online depends on how it is sold
- 应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
- Tsconfig of typescript TS basics JSON configuration options
猜你喜欢
[advanced MySQL] index details (I): index data page structure
Preparing for the interview and sharing experience
The latest Android interview collection, Android video extraction audio
Pre sale 179000, hengchi 5 can fire? Product power online depends on how it is sold
Open source OA development platform: contract management user manual
How does win11 unblock the keyboard? Method of unlocking keyboard in win11
Remember an experience of using selectmany
null == undefined
Reptile combat (VII): pictures of the king of reptiles' heroes
Blender exchange group, welcome to the water group ~
随机推荐
Use json Stringify() to realize deep copy, be careful, there may be a huge hole
Jerry's configuration of TWS cross pairing [article]
648. Word replacement
How to close eslint related rules
operator
Jerry's manual matching method [chapter]
VTOL in Px4_ att_ Control source code analysis [supplement]
OpenGL homework - Hello, triangle
PKPM 2020 software installation package download and installation tutorial
[advanced MySQL] index details (I): index data page structure
EasyCVR配置中心录像计划页面调整分辨率时的显示优化
Antd date component appears in English
. Net automapper use
The difference between NPM uninstall and RM direct deletion
Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda
反爬通杀神器
An in-depth understanding of fp/fn/precision/recall
How to quickly check whether the opening area ratio of steel mesh conforms to ipc7525
PDF文档签名指南