/// <summary> /// returns all solid bodies in the passed reference set /// </summary> /// <param name="workpart"></param> /// <param name="refset"></param> /// <returns></returns> public static List <Body> GetSolidBodiesFromRefset(Part workpart, ReferenceSet refset) { List <Body> solidBodies = new List <Body>(); List <NXObject> objList = refset.AskAllDirectMembers().ToList(); foreach (NXObject obj in objList) { Body body = TryConvertNxObjectToBody(obj); if (body != null && body.IsSolidBody) { solidBodies.Add(body); } } return(solidBodies); }