public bool SaveToDocument(out bool replace, ContainerType container = ContainerType.Edge) { replace = false; var getPointPlace = new Rhino.Input.Custom.GetPoint(); getPointPlace.SetCommandPrompt("Place the output. Select the type of geometry container?"); var listValues = new List <string> { "Edges", "Faces", "Cells", "MeshFaces", "MeshCells" }; //getPointPlace.AddOptionEnumSelectionList("saveAs", listValues, 0); int opList = getPointPlace.AddOptionList("Type", listValues, (int)container); getPointPlace.SetDefaultPoint(Centroid); var opRes = (int)container; while (true) { getPointPlace.Get(); if (getPointPlace.Result() == GetResult.Point) { break; } else if (getPointPlace.Result() == GetResult.Cancel) { return(false); } if (getPointPlace.Result() == GetResult.Option) { opRes = getPointPlace.Option().CurrentListOptionIndex; } } var placePoint = getPointPlace.Point(); if (getPointPlace.GotDefault()) { replace = true; } else { replace = false; this.Offset(placePoint - Centroid); } if (opRes == 0) { SaveAsEdges(); } else if (opRes == 1) { SaveAsFaces(); } else if (opRes == 2) { if (Cells.Count > 0) { SaveAsCells(true); } else { Rhino.RhinoApp.WriteLine("No cells in the PolyFrame, faces will be saved instead."); SaveAsFaces(); } } else if (opRes == 3) { SaveAsFaces(true); } else if (opRes == 4) { if (Cells.Count > 0) { SaveAsCells(true, true); } else { Rhino.RhinoApp.WriteLine("No cells in the PolyFrame, faces will be saved instead."); SaveAsFaces(true); } } return(true); }