I am looking for a way to save in a list the instances of my class (ArduraRepresentacion) that have properties and a constructor.
public class ArmaduraRepresentacion
{
Document doc;
View vistaBarra;
Rebar barraRefuerzo;
List<CurveElement> listaCurvas;
List<TextNote> listaTextos;
XYZ posicion;
List<Int32> listaCurvasId = new List<int>();
List<Int32> listaTextosId = new List<int>();
public ArmaduraRepresentacion(Document doc, View vista, Rebar barra)
{
this.doc = doc;
this.vistaBarra = vista;
this.barraRefuerzo = barra;
}
public List<Int32> ListaCurvasId
{
get { return listaCurvasId; }
set { this.listaCurvasId = value; }
}
}
I read about extensible storage and also about data storage that is provided by the Revit API. One of the limitations that can be observed is the types of data that can be stored.
I'm looking into serialization in binary, Json and in XML. But I have some concerns because I make references to RevitAPI classes and I don't think they are serializable.
My doubts is: The correct approach would be to create an entity for each property of my class and save it in a revit object?
Any help is welcome no matter how small.
I tried to use the Newtonsoft.json library to serialize my class instances but revit crashes, this crash is not a revit problem.