/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { IMesh mesh = new IMesh(); int eKey = -1; DA.GetData(0, ref mesh); DA.GetData(1, ref eKey); IElement e = mesh.GetElementWithKey(eKey); ITopologicHalfFacet[] hf = new ITopologicHalfFacet[e.HalfFacetsCount]; ITopologicSiblingHalfFacet[] shf = new ITopologicSiblingHalfFacet[e.HalfFacetsCount]; for (int i = 0; i < e.HalfFacetsCount; i++) { int[] data; e.GetHalfFacet(i + 1, out data); hf[i] = new ITopologicHalfFacet(data); shf[i] = new ITopologicSiblingHalfFacet(e.GetSiblingElementID(i + 1), e.GetSiblingHalfFacetID(i + 1)); } DA.SetDataList(0, e.Vertices); DA.SetData(1, e.TopologicDimension); DA.SetDataList(2, hf); DA.SetDataList(3, shf); DA.SetData(4, e.ToString()); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { ITopologicHalfFacet hf = new ITopologicHalfFacet(); DA.GetData(0, ref hf); int dim = 1; if (hf.Keys.Length > 2) { dim = 2; } DA.SetDataList(0, hf.Keys); DA.SetData(1, dim); }