在revit中有类似autocad的 xdata 空间可以增加额外资料的地方吗?

 

在Revit2011和之前的版本中,可以通过Shared Parameter来保存客户额外的数据。请看Revit的帮助。SDK中的CreateShared例子演示了其用法。

但是他有一个限制,就是只能想一个类别的对象添加数据,比如像墙添加一个共享参数,那么所有的墙都会有你添加的共享参数。不管你是否需要。

 

到了REvit2012, 有一个非常强劲的功能就是Extensible Storage功能。使用这个API可以只对你需要的对象添加数据。比如只对模型中的几个墙添加数据。具体请参考Revit帮助文档。 SDK中ExtensibleStorageManager例子演示了用法。

 

Extensible Storage

The Revit API now allows you to create your own class-like Schema data structures and attach instances of them to any Element in a Revit model. This functionality can be used to replace the technique of storing data in hidden shared parameters. Schema-based data is saved with the Revit model and allows for higher-level, metadata-enhanced, object-oriented data structures. Schema data can be configured to be readable and/or writable to all users, just a specific application vendor, or just a specific application from a vendor.

The extensible storage classes are all found in Autodesk.Revit.DB.ExtensibleStorage

  • Autodesk.Revit.DB.ExtensibleStorage.SchemaBuilder -- Used to create Schemas definitions
  • Autodesk.Revit.DB.ExtensibleStorage.Schema --Contains a unique schema identifier, read/write permissions, and a collection of data Field objects.
  • Autodesk.Revit.DB.ExtensibleStorage.Field  -- Contains data name, type, and unit information and is used as the key to access corresponding data in an Element
  • Autodesk.Revit.DB.ExtensibleStorage.FieldBuilder -- A helper class used with SchemaBuilder used when creating a new field.
  • Autodesk.Revit.DB.ExtensibleStorage.Entity -- An object containing data corresponding to a Schema that can then be inserted into an Element.

The following data types are currently supported:

  • int
  • short
  • double
  • float
  • bool
  • string
  • Guid
  • ElementId
  • Autodesk.Revit.DB.XYZ
  • Autodesk.Revit.DB.UV
  • Autodesk.Revit.DB.ExtensibleStorage.Entity (An instance of another Schema, also known as a SubSchema)
  • Array (as a System.Collections.Generic.IList<T>)
  • Map (as a System.Collections.Generic.IDictionary<TKey, TValue> – all types are supported for keys except double, float, XYZ, and UV


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值