Revit编程如何获取内置参数对应的中文字符串?

本文介绍在Revit中如何获取参数所属组的中文名称,利用LabelUtils类的GetLabelFor方法,可以轻松实现这一功能。此外还列举了LabelUtils提供的其他用于获取内置参数、单位类型等中文名称的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Revit中参数都有一个组,我们通过Definition.ParameterGroup 将会返回一个BuiltInParameterGroup类型的枚举对象。

如何获得这个对应的中文组的名字?


答:

通过

LabelUtils.GetLabelFor(BuiltInParameterGroup)既可以返回你要的结果。


LabelUtils还可以返回内置参数的对应字符串,显示单位,参数类型等等内置类型的对应字符串。

下面是所有可用的函数。


Public methodStatic memberGetLabelFor(BuiltInParameter)
Gets the user-visible name for a BuiltInParameter.
Public methodStatic memberGetLabelFor(BuiltInParameterGroup)
Gets the user-visible name for a BuiltInParameterGroup.
Public methodStatic memberGetLabelFor(DisplayUnitType)
Gets the user-visible name for a DisplayUnitType.
Public methodStatic memberGetLabelFor(ParameterType)
Gets the user-visible name for a ParameterType.
Public methodStatic memberGetLabelFor(UnitSymbolType)
Gets the user-visible name for a UnitSymbolType.
Public methodStatic memberGetLabelFor(UnitType)
Gets the user-visible name for a UnitType.
Public methodStatic memberGetLabelFor(DuctLossMethodType, Document)
Gets the user-visible name for a DuctLossMethodType.
Public methodStatic memberGetLabelFor(gbXMLBuildingType, Document)
Gets the user-visible name for a gbXMLBuildingType.
Public methodStatic memberGetLabelFor(PipeFlowState, Document)
Gets the user-visible name for a PipeFlowState.
Public methodStatic memberGetLabelFor(PipeLossMethodType, Document)
Gets the user-visible name for a PipeLossMethodType.

转载请复制以下信息:
原文链接: http://blog.youkuaiyun.com/joexiongjin/article/details/10149127
作者: 叶雄进 , Autodesk ADN

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值