Hi,
I have a function programmed in vb.net that controls the opacity of parts in the active view.
If the user is selecting objects and then starting the program the "non-Selected" Parts are disapearing step by step.
That's looking very intersting, but doesn't supports the user 🙂
Is it possible to freeze the active view of inventor and refresh it, when the job is done? So the user will only see the result of the process and not the working process.
Best Regards
Passi
Solved! Go to Solution.
Solved by Robert..F. Go to Solution.
Have you tried to wrap all your work up into a single transaction? This should prevent this from happening until the transaction is committed and possible solve your problem. I have not tested this but is just a thought.
The following code will do what you'd like to accomplish while dramatically increasing performance as well.
Sub PerformanceIncrease() Dim Invapp As Inventor.Application Set Invapp = ThisApplication Dim oDoc As Inventor.Document Set oDoc = Invapp.ActiveDocument '' Turn off user interaction so that inventor can focus on your API calls exclusively Invapp.UserInterfaceManager.UserInteractionDisabled = True '' Turn off screenupdating to speed up performance Invapp.ScreenUpdating = False '' Set Defer updates to true and force an update when you're finished with your API commands '' This can be done on drawings and sketches as well Invapp.AssemblyOptions.DeferUpdate = True ''Wrap your command into a global transaction so only one undo point is created. Dim oTrans As Inventor.Transaction Set oTrans = Invapp.TransactionManager.StartGlobalTransaction(oAssDoc, _ "My API Calls") '' perform your functions here '' Be sure to end a global transaction when you are finished oTrans.End '' Wrap up Invapp.ScreenUpdating = True Invapp.UserInterfaceManager.UserInteractionDisabled = False Call oDoc.Update Invapp.AssemblyOptions.DeferUpdate = False
First of all thanks a lot and ii to all of you.
Sorry for my late answer, but I try to make it as complete as possible 🙂
- The iLogic functionality only starts a "manual" refresh if needed. But it doesn't gives you the oppotunity to supress automatically generated inventor refreshs.
- The Transaction I've tried, because I also thought it might be some sort of solution. But it doesn't work for this Problem.
- The Inventor.Application.ScreenUpdating was the function, I've missed. So, that's the solution. If you want to show any inventor action, the value should be true or false, and you're right, it also improve the performance.
So, again thanks to all of you and I marked it as solution.
Best Regards
Passi