EaBIM

标题: Revit中类似Autocad的Xdata空间 [打印本页]

作者: 萧闫子    时间: 2014-1-9 13:22
标题: Revit中类似Autocad的Xdata空间
在Revit2011和之前的版本中,可以通过Shared Parameter来保存客户额外的数据。请看Revit的帮助。SDK中的CreateShared例子演示了其用法。
但是他有一个限制,就是只能想一个类别的对象添加数据,比如像墙添加一个共享参数,那么所有的墙都会有你添加的共享参数。不管你是否需要。
到了REvit2012, 有一个非常强劲的功能就是Extensible Storage功能。使用这个API可以只对你需要的对象添加数据。比如只对模型中的几个墙添加数据。具体请参考Revit帮助文档。 SDK中ExtensibleStorageManager例子演示了用法。
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 definitionsAutodesk.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 ElementAutodesk.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:
intshortdoublefloatboolstringGuidElementIdAutodesk.Revit.DB.XYZAutodesk.Revit.DB.UVAutodesk.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


作者: 开始了d    时间: 2014-2-20 14:27
顶起来…………




欢迎光临 EaBIM (https://eabim.net/) Powered by Discuz! X3.2