Пример #1
0
 static void Main(string[] args)
 {
     IfcConvert.Convert("sample.ifc", "sample.obj");
     IfcConvert.Convert("sample.ifc", "sample.xml");
     IfcConvert.Convert("sample.ifc", "sample.dae");
     IfcConvert.Convert("sample.ifc", "sample.igs");
     IfcConvert.Convert("sample.ifc", "sample.svg");
 }
Пример #2
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter = "OBJ Files|*.obj";
            saveFileDialog.Title  = "Export As";

            string currentDir = Directory.GetCurrentDirectory();

            txtMessage.Text = "";


            // Show the Dialog.
            // If the user clicked OK in the dialog and
            // a .CUR file was selected, open it.
            if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Directory.SetCurrentDirectory(currentDir);
                // Assign the cursor in the Stream to the Form's Cursor property.
                string outputFilePath = saveFileDialog.FileName;


                if (File.Exists(outputFilePath))
                {
                    File.Delete(outputFilePath);
                }

                IfcConvert.Convert(txtIFC.Text, outputFilePath, message =>
                {
                    AppendText(message);
                });

                IfcConvert.Convert(txtIFC.Text, outputFilePath.Replace(".obj", ".xml"), message =>
                {
                    AppendText(message);
                });
            }
            else
            {
                Directory.SetCurrentDirectory(currentDir);
            }
        }