As part of a project, I have a rather long macro to do (creation of several shots + sketches) to repeat in a loop. Everything works but slowly, very slowly. At each step of calculation (restart of my loop) I delete the previous construction to lighten the model. In addition, each time I create a plan or sketch I hide it (Part.BlankRefGeom or Part.BlankSketch). But here's my problem: the program is always slow (partly due to the fact that SW created the plan or the sketch and then only after the mask so the construction step still appears for a short time and burns the resource), do you have a technique to completely hide the construction (ask SW not to display it)?
Yes it works but respecting a few rules to see here in the chapter "Remarks", taking into account that "ISldWorks::UserControl" is equal to True by default when Solidworks is not launched by your program.
So to make Solidworks invisible if it is not launched by your program, there must be no document open in Solidworks and put "swApp.UserControl = False" before the line "swApp.Visible = False".
Be careful, if you quit your program with Solidworks invisible, it will remain open but in invisible mode so you must remember to either make it visible or close it before quitting your program.