Message 1 of 4
Revit API eStorage without association

Not applicable
07-10-2014
07:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Revit 2015 .NET API eStorage
I have two questions inregards to estorage\
1. How to do a create a storage to store information without associating to an entity.
I wanted to have some general infomraiton stored.
// Create a data structure, attach it to a wall, populate it with data, and retrieve the data back from the wall void StoreDataInWall(Wall wall, XYZ dataToStore) { Transaction createSchemaAndStoreData = new Transaction(wall.Document, "tCreateAndStore"); createSchemaAndStoreData.Start(); SchemaBuilder schemaBuilder = new SchemaBuilder(new Guid("720080CB-DA99-40DC-9415-E53F280AA1F0")); schemaBuilder.SetReadAccessLevel(AccessLevel.Public); // allow anyone to read the object schemaBuilder.SetWriteAccessLevel(AccessLevel.Vendor); // restrict writing to this vendor only schemaBuilder.SetVendorId("ADSK"); // required because of restricted write-access schemaBuilder.SetSchemaName("WireSpliceLocation"); // create a field to store an XYZ FieldBuilder fieldBuilder = schemaBuilder.AddSimpleField("WireSpliceLocation", typeof(XYZ)); fieldBuilder.SetUnitType(UnitType.UT_Length); fieldBuilder.SetDocumentation("A stored location value representing a wiring splice in a wall."); Schema schema = schemaBuilder.Finish(); // register the Schema object Entity entity = new Entity(schema); // create an entity (object) for this schema (class) // get the field from the schema Field fieldSpliceLocation = schema.GetField("WireSpliceLocation"); // set the value for this entity entity.Set<XYZ>(fieldSpliceLocation, dataToStore, DisplayUnitType.DUT_METERS); wall.SetEntity(entity); // store the entity in the element // get the data back from the wall Entity retrievedEntity = wall.GetEntity(schema); XYZ retrievedData = retrievedEntity.Get<XYZ>(schema.GetField("WireSpliceLocation"), DisplayUnitType.DUT_METERS); createSchemaAndStoreData.Commit(); }
based on this example from dev guide.
2. If i need to create a eStore which can be accessed only by using my vendor id and application.
what settings should that value for read and write.
When I specify a vendor ID its give me an error.
So If I specificy vendor ID in it other developer cannot edit or delete those values right?
Thanks for your help.