/// <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) { ITopologicSiblingHalfFacet shf = new ITopologicSiblingHalfFacet(); DA.GetData(0, ref shf); DA.SetData(0, shf.ElementID); DA.SetData(1, shf.HalfFacetID); }