Revit开发之参数详解


在Revit里所有的参数值可以分为5中类型:

NoneNone represents an invalid storage type. This value should not be used.
IntegerThe internal data is stored in the form of a signed 32 bit integer.
DoubleThe data will be stored internally in the form of an 8 byte floating point number.
StringThe internal data will be stored in the form of a string of characters.
ElementIdThe data type represents an element and is stored as the id of the element. 

每个Paramter的参数值类型可以通过Parameter.StorageType来判断

StorageType是一个枚举包含了上面5中参数值类型,

对于StorageType为StorageType.None的参数,不能通过Parameter.Set()来设置,

也不能重Parameter直接获取到它的值。

对于Integer可以通过Parameter.AsInteger()来获取它们的值

对于Double可以通过Parameter.AsDouble()来获取他们的值,这个返回的是一个英尺单位的值,

还可以通过Parameter.AsValueString(),获取它对于的毫米单位值对应的String。

(比如有一个200.0,你通过AsDouble()得到的是200.0转换的英尺的值,而用AsValueString()得到一个为 “200.0“  的string)

对于String可以通过Parameter.AsString()来获取他们的值

对于ElementId 可以通过Parameter.AsElementId()来获取他们的值


在Set值的时候

传入的参数一定要个Parameter的StorageType对应起来



博主会经常更新一些技术文章,请大家多多关注,多多交流

更多技术交流,请加qq群480950299


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值