示例#1
0
        /// <summary>
        /// Export STL and wait for virtual machine to provide test.png in a given location
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ManufacturingCheck_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // Disable the manufacturing check button while we load
            ManufacturingCheck.IsEnabled = false;

            // Disable translation of part into positive space when exporting
            SldWorks app = SolidWorksEnvironment.Application.UnsafeObject;

            app.SetUserPreferenceToggle(((int)swUserPreferenceToggle_e.swSTLDontTranslateToPositive), true);

            // Clear current selection so STL export contains all bodies
            var model = (ModelDoc2)app.ActiveDoc;

            model.ClearSelection();

            // Set export location
            var STL_Save_Location = string.Concat(MSculptPrint_Folder, "test.stl");

            // Export SolidWorks View - bottom, z-symmetric view for lathe pieces
            model.ShowNamedView2("", (int)swStandardViews_e.swBottomView);

            // Isometric view useful for mill parts
            //model.ShowNamedView2("", (int)swStandardViews_e.swIsometricView);

            model.ViewZoomtofit2();
            var PNG_Save_Location = string.Concat(MSculptPrint_Folder, "View_SW.png");

            // Export to fixed location
            bool saved    = ExportModelAsStl(STL_Save_Location);
            bool savedPNG = ExportModelAsPNG(PNG_Save_Location);

            if (saved & savedPNG)
            {
                // Show DFM Reults loading message box

                MessageBox_DFMLoading DFMLoading = new MessageBox_DFMLoading("View_Researcher_Feedback.png", MClient);
                DialogResult          DFM_Result = DFMLoading.ShowDialog();

                // If the form outputs a DialogResult of Yes, then we have the file!
                if (DFM_Result == DialogResult.Yes)
                {
                    DFMLoading.Close();
                    MessageBox_DFMResults DFMResults = new MessageBox_DFMResults(FeedbackPNG_Save_Location);
                    DFMResults.Show();
                }
            }
        }
示例#2
0
        private void ReloadResults_Click(object sender, RoutedEventArgs e)
        {
            MessageBox_DFMResults DFMResults = new MessageBox_DFMResults(FeedbackPNG_Save_Location);

            DFMResults.Show();
        }