Announcement

Collapse
No announcement yet.

Extensible Storage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Extensible Storage

    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?


    Code:
            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.Public);
                schemaBuilder.SetWriteAccessLevel(AccessLevel.Vendor);
                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...


    Code:
       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 "";
           }
    Last edited by n8wex; July 15, 2011, 02:20 PM.

    #2
    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?
    Martijn de Riet
    Professional Revit Consultant | Revit API Developer
    MdR Advies
    Planta1 Revit Online Consulting

    Comment


      #3
      Originally posted by n8wex View Post
      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.
      Phillip Miller
      Kiwi Codes Solutions Ltd
      Makers of "Family Browser" and "Project Browser" for Revit.

      Comment


        #4
        Originally posted by KiwiCodes View Post
        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.

        Comment

        Related Topics

        Collapse

        Working...
        X