2 Replies Latest reply on Feb 9, 2016 9:09 PM by Meredith McKay

    How can i autoclose solidworks messagebox or errorboxes?

    Meredith McKay

      Hi i am trying to open up solidworks parts and getting a creation date from them here is the link to my previous post SLDPRT duplicates . My program works and it opens up a million or so parts but some parts are promting me with error messages or message boxes and i have tried to turn of the message prompts like this..

      SldWorks swApp = new SldWorks();

                              swApp.Visible = false;

                              swApp.UserControl = false;

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swExtRefOpenReadOnly, true);//Accesse properties system options and toggles on "Open referenced documents with read-only access."

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swExtRefNoPromptOrSave, true);//Don't prompt to save read-only referenced documents (discard changes)

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swLoadExternalReferences, (int)swLoadExternalReferences_e.swLoadExternalReferences_None);//Load refrenced documents set to none

       

       

                              //Messages and Errors

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swShowErrorsEveryRebuild, false);//show errors every rebuild

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swWarnSaveUpdateErrors, false);//Warn before saving documents with update errors

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swFeatureManagerDisplayWarnings, (int)swFeatureManagerDisplayWarnings_e.swFeatureManagerDisplayNoWarnings);//Display FeatureManager tree warnings set to never

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swShowEquationCircularReferencesMessage, ((int)swDisplayCircularReferencesInEquations_e.swDisplayCircularReferencesInEquationsNever));//

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swShowEquationPotentialCircularReferencesMessage, ((int)swDisplayPotentialCircularReferencesInEquations_e.swDisplayPotentialCircularReferencesInEquationsNever));

                              //Performance

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swPerformanceVerifyOnRebuild, false);

                              swApp.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swPerformanceSheetMetalIgnoreSelfIntersect, false);

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swCheckForOutOfDateLightweightComponents, int)swCheckOutOfDate_e.swCheckOutOfDate_DoNotCheck);

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swResolveLightweight, (int)swPromptAlwaysNever_e.swResponseNever);

                              swApp.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swPerformanceAssemRebuildOnLoad, (int)swPromptAlwaysNever_e.swResponseNever);

       

      but still some errors do pop in. Is there anyway i can remove error boxes programatically. Please help.