void CreateLabeledPolyOutline(NPointF[] points, NPolygonShape polyShape, NNodeList labels, string title) { NNodeList nodes = new NNodeList(); nodes.Add(polyShape); if (labels != null) { nodes.AddRange(labels); } int length = points.Length - 1; int vIndex = 0, hIndex = 0, index = 0; for (int i = 0; i < length; i++) { nodes.Add(ConnectPointsLabeled(points[i], points[i + 1], ref hIndex, ref vIndex, ref index)); } nodes.Add(ConnectPointsLabeled(points[points.Length - 1], points[0], ref hIndex, ref vIndex, ref index)); NGroup g; NBatchGroup batchGroup = new NBatchGroup(document); batchGroup.Build(nodes); batchGroup.Group(document.ActiveLayer, true, out g); g.Name = title + " Group"; }