private void openCADFileToolStripMenuItem_Click(object sender, EventArgs e) { var fd = new Rhino.UI.OpenFileDialog { Filter = "CAD Files (*.3dm;*.step)|*.3dm;*.step" }; fileName = fd.FileName; if (fd.ShowOpenDialog() == true) { fileName = fd.FileName; // MessageBox.Show(fileName, "File directory"); } else { MessageBox.Show("no file is selected"); } if (fileName != null) { RhinoDoc.OpenFile(fileName); doc.Views.Redraw(); } //doc.Views.Redraw(); }
private void openXMLToolStripMenuItem_Click(object sender, EventArgs e) { var fdXml = new Rhino.UI.OpenFileDialog { Filter = "XML Files (*.xml)|*.xml" }; if (fdXml.ShowOpenDialog() == true) { xmlfileName = fdXml.FileName; result = XmlHelper.FromXmlFile <Product>(xmlfileName); if (result.filepath != null) { RhinoDoc.OpenFile(result.filepath); doc.Views.Redraw(); } else { MessageBox.Show("The given file cannot be successfully open"); } } else { MessageBox.Show("no file is selected"); } }
public static void _OpenFileWithoutSaveConfirmationDialog(this RhinoDoc doc, string filename) { _ClearDocumentChanges(doc); RhinoDoc.OpenFile(filename); }