PDA

View Full Version : Extensible Storage



n8wex
July 15th, 2011, 02:11 PM
Has anyone used this? Is it slow to sore data on an entity?

I am storing text data and it is not instant it takes around 5sec to commit. Is this normal?



public static void SetData(Element element, string fieldName, string value, Guid guid)
{
var trans = new Transaction(Document, "n8_CreateAndStore");
trans.Start();
var schemaBuilder = new SchemaBuilder(guid);

schemaBuilder.SetReadAccessLevel(AccessLevel.Publi c);
schemaBuilder.SetWriteAccessLevel(AccessLevel.Vend or);
schemaBuilder.SetVendorId("N83D");

FieldBuilder fieldBuilder = schemaBuilder.AddSimpleField(fieldName, typeof(string));
fieldBuilder.SetDocumentation("A stored string value " + fieldName);

schemaBuilder.SetSchemaName(fieldName);
var schema = schemaBuilder.Finish();
var entity = new Entity(schema);

var field = schema.GetField(fieldName);
entity.Set(field, value);
element.SetEntity(entity);

trans.Commit();
}


luckily retrieving the data is quick...



public static string GetData(Element element, string fieldName, Guid guid)
{
Schema schema = Schema.Lookup(guid);
Entity retrievedEntity;

if (schema != null)
{
retrievedEntity = element.GetEntity(schema);

if (retrievedEntity.Schema != null)
{
return retrievedEntity.Get<string>(schema.GetField(fieldName));
}
}

return "";
}

mdradvies
July 16th, 2011, 10:30 PM
Sorry, could you elaborate? What are you trying to do here? It doesn't seem to do anything with me... Do I need a 3D geometry here?

KiwiCodes
July 16th, 2011, 10:57 PM
Has anyone used this? Is it slow to sore data on an entity?

I am storing text data and it is not instant it takes around 5sec to commit. Is this normal?



Unfortunatelky there is a Pause. During Alpha/Beta testing I bought it up as, as you say I was noticing an approx 5 sec delay. I have since used ExS on the RTM version of Revit and it did seem better. Certinally not a 5 sec delay.

n8wex
July 17th, 2011, 11:16 AM
Unfortunatelky there is a Pause. During Alpha/Beta testing I bought it up as, as you say I was noticing an approx 5 sec delay. I have since used ExS on the RTM version of Revit and it did seem better. Certinally not a 5 sec delay.

Lets hope the next version has a 4-5sec improvment.. Cheers.