freeze SolidWorks graphics updates
Posted: Fri Oct 07, 2022 7:39 am
Is there a way to freeze SolidWorks graphics updates?
I am not talking about freezing graphic updates of a certain IModelDoc2, which can be achieved using IModelView.EnableGraphicsUpdate and IFeatureManager.EnableFeatureTree.
I am talking about the SolidWorks level, where a user can see e.g. if a file gets opened or closed.
Actual problem I want to solve:
I have a program/macro that should modify some data in some model docs, but the user should not see this (mainly due to performance considerations). So I open all docs that I need to update invisibly. More often than not it turns out that invisible documents do not allow certain operations - I can use the API methods but they do not modify the data, or they even crash Swx. So for some operations, like changing design table options, I need the document to be visible. So I make it visible via IModelDoc2.Visible=true, do my data modifications, then make it invisible again (which by the way is NOT as easy as setting IModelDoc2.Visible=false... but it can be done).
This brief phase of visibility can be seen in Swx, like in this gif here (if it does not play, click on it):
If the visibility phase is longer (due to more operations being done) I can imagine that the user will even see the geometry of the (shortly) visible file being built up.
I want to hide all that from the user.
I am not talking about freezing graphic updates of a certain IModelDoc2, which can be achieved using IModelView.EnableGraphicsUpdate and IFeatureManager.EnableFeatureTree.
I am talking about the SolidWorks level, where a user can see e.g. if a file gets opened or closed.
Actual problem I want to solve:
I have a program/macro that should modify some data in some model docs, but the user should not see this (mainly due to performance considerations). So I open all docs that I need to update invisibly. More often than not it turns out that invisible documents do not allow certain operations - I can use the API methods but they do not modify the data, or they even crash Swx. So for some operations, like changing design table options, I need the document to be visible. So I make it visible via IModelDoc2.Visible=true, do my data modifications, then make it invisible again (which by the way is NOT as easy as setting IModelDoc2.Visible=false... but it can be done).
This brief phase of visibility can be seen in Swx, like in this gif here (if it does not play, click on it):
If the visibility phase is longer (due to more operations being done) I can imagine that the user will even see the geometry of the (shortly) visible file being built up.
I want to hide all that from the user.