C# Class ExtensibleStorageManager.StorageCommand

A static class that issues sample commands to a SchemaWrapper to demonstrate schema and data storage.
Exibir arquivo Open project: AMEE/revit Class Usage Examples

Public Methods

Method Description
CreateSetAndExport ( Element storageElement, string xmlPathOut, System.Guid schemaId, AccessLevel readAccess, AccessLevel writeAccess, string vendorId, string applicationId, string name, string documentation, SampleSchemaComplexity schemaComplexity ) : SchemaWrapperTools.SchemaWrapper

Creates a new sample Schema, creates an instance of that Schema (an Entity) in the given element, sets data on that element's entity, and exports the schema to a given XML file.

CreateWrapperFromSchema ( System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void

Given an Autodesk.Revit.DB.ExtensibleStorage.Schema that already exists, create a SchemaWrapper containing that Schema's data.

EditExistingData ( Element storageElement, System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void

Create a SchemaWrapper from a Schema Guid and try to find an Entity of a matching Guid in a given Element. If successfull, try to change the data in that Entity.

ImportSchemaFromXml ( string path, SchemaWrapperTools &sWrapper ) : void

Given an xml path containing serialized schema data, create a new Schema and SchemaWrapper

LookupAndExtractData ( Element storageElement, System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void

Given an element, try to find an entity containing instance data from a given Schema Guid.

NewGuid ( ) : System.Guid

Create a new pseudorandom Guid

Private Methods

Method Description
ComplexSchemaAndData ( SchemaWrapperTools mySchemaWrapper, Element storageElement, string xmlPathOut, System.Guid schemaId, AccessLevel readAccess, AccessLevel writeAccess, string vendorId, string applicationId, string name, string documentation, System.Entity &storageElementEntityWrite ) : void

Adds a simple fields, arrays, maps, subEntities, and arrays and maps of subEntities to a SchemaWrapper and Entity

SimpleSchemaAndData ( SchemaWrapperTools mySchemaWrapper, System.Entity &storageElementEntityWrite ) : void

Adds several small, simple fields to a SchemaWrapper and Entity

Method Details

CreateSetAndExport() public static method

Creates a new sample Schema, creates an instance of that Schema (an Entity) in the given element, sets data on that element's entity, and exports the schema to a given XML file.
public static CreateSetAndExport ( Element storageElement, string xmlPathOut, System.Guid schemaId, AccessLevel readAccess, AccessLevel writeAccess, string vendorId, string applicationId, string name, string documentation, SampleSchemaComplexity schemaComplexity ) : SchemaWrapperTools.SchemaWrapper
storageElement Element
xmlPathOut string
schemaId System.Guid
readAccess AccessLevel
writeAccess AccessLevel
vendorId string
applicationId string
name string
documentation string
schemaComplexity SampleSchemaComplexity
return SchemaWrapperTools.SchemaWrapper

CreateWrapperFromSchema() public static method

Given an Autodesk.Revit.DB.ExtensibleStorage.Schema that already exists, create a SchemaWrapper containing that Schema's data.
public static CreateWrapperFromSchema ( System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void
schemaId System.Guid The Guid of the existing Schema
schemaWrapper SchemaWrapperTools
return void

EditExistingData() public static method

Create a SchemaWrapper from a Schema Guid and try to find an Entity of a matching Guid in a given Element. If successfull, try to change the data in that Entity.
public static EditExistingData ( Element storageElement, System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void
storageElement Element
schemaId System.Guid
schemaWrapper SchemaWrapperTools
return void

ImportSchemaFromXml() public static method

Given an xml path containing serialized schema data, create a new Schema and SchemaWrapper
public static ImportSchemaFromXml ( string path, SchemaWrapperTools &sWrapper ) : void
path string
sWrapper SchemaWrapperTools
return void

LookupAndExtractData() public static method

Given an element, try to find an entity containing instance data from a given Schema Guid.
public static LookupAndExtractData ( Element storageElement, System.Guid schemaId, SchemaWrapperTools &schemaWrapper ) : void
storageElement Element The element to query
schemaId System.Guid The id of the Schema to query
schemaWrapper SchemaWrapperTools
return void

NewGuid() public static method

Create a new pseudorandom Guid
public static NewGuid ( ) : System.Guid
return System.Guid