Git Product home page Git Product logo

vcextensiblestorageextension's Introduction

Reivt.ES.Extension

Provide an easy way to use Revit Extensible Storage features

Installation

Use NuGet Package Manager Revit.ES.Extension

vcextensiblestorageextension's People

Contributors

boostyourbim avatar chekalin-v avatar ecodomus avatar harrymattison avatar sennevds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vcextensiblestorageextension's Issues

Object not set to a reference when using multiple classes

I'm trying to use your extension and saving my data works perfect but when I try to retreive the data back I get Object not set to a reference.
I have the following classes:

[Schema("74b729c1-60eb-4a67-bc75-70e0b76cfbcb",
    "ViewClassSchema")]
    [ImplementPropertyChanged]
    public class ViewClass: IRevitEntity
    {
        [Field]
        public string Name { get; set; }

        [Field]
        public bool IsActive { get; set; }

        [Field]
        public ElementId Id { get; set; }
    }

    [Schema("518F465C-8E3A-49AC-BA9E-0431036968C8",
    "SetSchema")]
    [ImplementPropertyChanged]
    public class Set : IRevitEntity
    {
        [Field]
        public string Name { get; set; }

        [Field]
        public ObservableCollection<SetCondition> Rules { get; set; }

        [Field]
        public SetCondition InverseRule { get; set; }

        [Field]
        public List<ViewClass> SelectedCategories { get; set; }

        [Field]
        public ParameterClass SelectedParameter { get; set; }
        
    }

    [Schema("12286B88-454A-46CA-AF5E-C90C58AA0B31",
    "SetConditionSchema")]
    [ImplementPropertyChanged]
    public class SetCondition : IRevitEntity
    {
        [Field]
        public bool IsActive { get; set; }

        [Field]
        public string Value { get; set; }

        [Field]
        public int Type { get; set; }

        private System.Windows.Media.Color filterColor;
        public System.Windows.Media.Color FilterColor
        {
            get
            {
                return filterColor;
            }
            set
            {
                filterColor = value;
                FilterColorA = filterColor.A;
                FilterColorR = filterColor.R;
                FilterColorG = filterColor.G;
                FilterColorB = filterColor.B;
            }
        }

        [Field]
        public int FilterColorR { get; set; }

        [Field]
        public int FilterColorG { get; set; }

        [Field]
        public int FilterColorB { get; set; }

        [Field]
        public int FilterColorA { get; set; }
    }

    [Schema("94e42b1e-ce3a-48c7-926a-8fb94869b0d3",
    "ParameterClassSchema")]
    [ImplementPropertyChanged]
    public class ParameterClass : IRevitEntity
    {
        [Field]
        public string Name { get; set; }

        [Field]
        public ElementId Id { get; set; }
    }

I've debugged the code and it fails when retreiving the data for the InverseRule.
In the following method: private object GetEntityFieldValue(Entity entity, Field field, Type fieldValueType) the code tries to retrieve the entityValue but it has no Schema and no Guid. The unittype of the field is UT_Undefined

Edit:
Found why it's crashing:
If an object is null it gets a valid entityvalue but the Schema and Guid are empty.
In public TRevitEntity Convert(Entity entity) where TRevitEntity : class, IRevitEntity
you check if the entityValue is empty but not if the schema is empty if you add that extra check it works

Schema creator bug fixed

in ScheamCreator.cs
schemaAttribute.VendorId = schemaAttribute.VendorId;

it shall be

schemaBuilder.SetVendorId( schemaAttribute.VendorId);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.