当前位置:网站首页>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);
边栏推荐
- Reinforcement learning - learning notes 9 | multi step TD target
- Remember an experience of using selectmany
- How to choose the appropriate automated testing tools?
- ByteDance senior engineer interview, easy to get started, fluent
- [colmap] sparse reconstruction is converted to mvsnet format input
- It's worth seeing. Interview sites and interview skills
- PKPM 2020软件安装包下载及安装教程
- OpenGL job coordinate system
- How to realize the movement control of characters in horizontal game
- Px4 autonomous flight
猜你喜欢
[开源] .Net ORM 访问 Firebird 数据库
[advanced MySQL] index details (I): index data page structure
Pdf document signature Guide
[JDBC Part 1] overview, get connection, CRUD
Debugging and handling the problem of jamming for about 30s during SSH login
null == undefined
Firefox browser installation impression notes clipping
为什么Win11不能显示秒数?Win11时间不显示秒怎么解决?
建立自己的网站(18)
DNS series (I): why does the updated DNS record not take effect?
随机推荐
SAR image quality evaluation
The essence of analog Servlet
Win11U盘不显示怎么办?Win11插U盘没反应的解决方法
Lingyun going to sea | saihe & Huawei cloud: jointly help the sustainable development of cross-border e-commerce industry
It's worth seeing. Interview sites and interview skills
建立自己的网站(18)
Win11时间怎么显示星期几?Win11怎么显示今天周几?
Reinforcement learning - learning notes 9 | multi step TD target
OpenGL configure assimp
How to realize the movement control of characters in horizontal game
Use partial derivatives to display normals in unity
Leetcode SQL first day
【JDBC Part 1】概述、获取连接、CRUD
Firefox browser installation impression notes clipping
Two methods of calling WCF service by C #
戴森官方直营店免费造型服务现已开放预约 先锋科技诠释护发造型理念,助力消费者解锁多元闪耀造型
operator
Jerry's test box configuration channel [chapter]
Time standard library
OpeGL personal notes - lights