protected override void SolveInstance(IGH_DataAccess DA) { Mesh mesh_input = null; Curve c = null; double extra = 0.0; GeometryBase geo = null; if (!DA.GetData("Geo", ref geo)) { this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "No input geometry."); } if (!DA.GetData("Curve", ref c)) { this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "No guide curve."); } DA.GetData("Extra", ref extra); if (geo is Brep) { mesh_input = Mesh.CreateFromBrep(geo as Brep, MeshingParameters.QualityRenderMesh).Amalgamate(); } else if (geo is Mesh) { mesh_input = geo as Mesh; } else { this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Failed to parse geometry."); } double w, h, l; Glulam g = Glulam.CreateGlulamFromBeamGeometry2(c, mesh_input, out w, out h, out l, extra); DA.SetData("Glulam", new GH_Glulam(g)); DA.SetDataList("Dimensions", new double[] { w, h, l }); }