I tested using the HoneybeeSchema.
I created a JSON file using a python component and serialized a face from the dictionary.
dic = face.to_dict()
a = json.dumps(dic)
but once a use Face.FromJson
into a C# component in GH I have this error, even if the DLL is referenced.
1. Error (CS0012): The type 'System.ComponentModel.DataAnnotations.IValidatableObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. (line 58)
If I use Face.FromJson
into a custom component, I am dealing with this kind of error.
@chris and @MingboPeng any suggestions?
I can’t upload the file because I am a new user.
This is the Json
{"display_name": "Walls_Rv", "identifier": "Walls_Rv_6bd0662f_0", "geometry": {"type": "Face3D", "plane": {"o": [-2.0, -0.5, 0.0], "n": [0.0, -1.0, 0.0], "type": "Plane", "x": [1.0, 0.0, 0.0]}, "boundary": [[-2.0, -0.5, 0.25], [-2.0, -0.5, 0.0], [2.0, -0.5, 0.0], [2.0, -0.5, 0.25]]}, "face_type": "Wall", "boundary_condition": {"view_factor": {"type": "Autocalculate"}, "sun_exposure": true, "wind_exposure": true, "type": "Outdoors"}, "type": "Face", "properties": {"radiance": {"type": "FaceRadianceProperties"}, "energy": {"construction": {"display_name": "Walls_Rv", "type": "OpaqueConstruction", "identifier": "Walls_Rv", "materials": [{"conductivity": 0.2142857142857143, "specific_heat": 920.0, "density": 2000.0, "thermal_absorptance": 0.90000000000000002, "thickness": 0.29999999999999999, "solar_absorptance": 0.59999999999999998, "visible_absorptance": 0.59999999999999998, "display_name": "Walls_Rv", "roughness": "MediumRough", "type": "EnergyMaterial", "identifier": "Walls_Rv"}]}, "type": "FaceEnergyProperties"}, "type": "FaceProperties"}}
Blockquote