当前位置:网站首页>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);
边栏推荐
- Add get disabled for RC form
- Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
- 【Azure微服务 Service Fabric 】如何转移Service Fabric集群中的种子节点(Seed Node)
- Use blocconsumer to build responsive components and monitor status at the same time
- OpenGL job - texture
- Programming mode - table driven programming
- Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department
- Implementation method of data platform landing
- Write in front -- Talking about program development
- Overseas agent recommendation
猜你喜欢
Remember an experience of using selectmany
The whole network "chases" Zhong Xuegao
PKPM 2020软件安装包下载及安装教程
Ad domain group policy management
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
Jerry's about TWS pairing mode configuration [chapter]
UWA问答精选
An in-depth understanding of fp/fn/precision/recall
Implementation method of data platform landing
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
随机推荐
An in-depth understanding of fp/fn/precision/recall
How to write an augmented matrix into TXT file
嵌入式开发:如何为项目选择合适的RTOS?
Debugging and handling the problem of jamming for about 30s during SSH login
How polardb-x does distributed database hotspot analysis
Use partial derivatives to display normals in unity
The free styling service of Dyson's official direct store is now open for appointment. Pioneer Technology interprets the styling concept of hair care and helps consumers unlock diversified and shiny s
Crawler (17) - Interview (2) | crawler interview question bank
DBSync新增对MongoDB、ES的支持
The function is really powerful!
Tsconfig of typescript TS basics JSON configuration options
Jerry's fast pairing does not support canceling pairing [article]
双塔模型的最强出装,谷歌又开始玩起“老古董”了?
谈谈制造企业如何制定敏捷的数字化转型策略
Solve the problem of uni in uni app Request sent a post request without response.
Jerry's manual matching method [chapter]
用语雀写文章了,功能真心强大!
Ant destination multiple selection
Get the exact offset of the element
Welcome to CSDN markdown editor