Provide an easy way to use Revit Extensible Storage features
Use NuGet Package Manager Revit.ES.Extension
Provide an easy way to use Revit Extensible Storage features
No more DB.UnitType, DB.DisplayUnitType in Revit 2022
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
in ScheamCreator.cs
schemaAttribute.VendorId = schemaAttribute.VendorId;
it shall be
schemaBuilder.SetVendorId( schemaAttribute.VendorId);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.