当前位置:网站首页>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);
边栏推荐
- Use partial derivatives to display normals in unity
- Jerry's manual matching method [chapter]
- NVR hard disk video recorder is connected to easycvr through the national standard gb28181 protocol. What is the reason why the device channel information is not displayed?
- Main functions of OS, Sys and random Standard Libraries
- 【Azure微服务 Service Fabric 】在SF节点中开启Performance Monitor及设置抓取进程的方式
- Interview question 01.02 Determine whether it is character rearrangement - auxiliary array algorithm
- Which financial products will yield high returns in 2022?
- 【colmap】稀疏重建转为MVSNet格式输入
- 怎样写一个增广矩阵到txt文件中
- operator
猜你喜欢
An in-depth understanding of fp/fn/precision/recall
Blender exchange group, welcome to the water group ~
反爬通杀神器
It's worth seeing. Interview sites and interview skills
How to make agile digital transformation strategy for manufacturing enterprises
100million single men and women "online dating", supporting 13billion IPOs
Jerry's about TWS pairing mode configuration [chapter]
Implementation method of data platform landing
海外代理推荐
Node:504 error reporting
随机推荐
VTOL in Px4_ att_ Control source code analysis [supplement]
Welcome to CSDN markdown editor
QT compile IOT management platform 39 alarm linkage
Use blocconsumer to build responsive components and monitor status at the same time
Jerry's about TWS pairing mode configuration [chapter]
PKPM 2020软件安装包下载及安装教程
嵌入式开发:如何为项目选择合适的RTOS?
Record a garbled code during servlet learning
OpenGL jobs - shaders
Matplotlib drawing interface settings
Jerry's test box configuration channel [chapter]
OpenGL configure assimp
OpenGL homework - Hello, triangle
【Azure微服务 Service Fabric 】因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)
Customer case | China law network, through observing the cloud, greatly shortens the time of fault location
L'enregistreur de disque dur NVR est connecté à easycvr par le Protocole GB 28181. Quelle est la raison pour laquelle l'information sur le canal de l'appareil n'est pas affichée?
ByteDance senior engineer interview, easy to get started, fluent
[interview arrangement] 0211 game engine server
Typescript TS basic knowledge type declaration
Why can't win11 display seconds? How to solve the problem that win11 time does not display seconds?