Hello,
I am currently working on a project where i use mmAPI and Python to automate a repair process for broken .stl files and calculate the boolean difference of repaired meshes. With the help of various @MagWeb posts i managed to accomplish this. I sometimes run into dialogs when trying to save a mesh (see attached picture) or errors when for example the boolean difference calculation failed. My question is: Is there a way to handle those dialogs / errors within my python script without clicking back into meshmixer and manually click "continue"?
Thank you in advance! 🙂
Solved! Go to Solution.
Solved by MagWeb. Go to Solution.
There's no way I know handling such dialogs within mmApi
On WIN10 and my Phython3 built of mmApi I do some workaround to handle such cases:
ad 1: I use pygetwindow library
ad 2: I use keyboard library
import pygetwindow as gw
import keyboard
# set focus to Meshmixer
MM = gw.getWindowsWithTitle('Autodesk Meshmixer')[0]
MM.activate()
# hit enter to accept dialog
keyboard.press_and_release('enter')
### alternative: hit esc to cancel dialog
##keyboard.press_and_release('esc')
Gunter Weber
Triangle Artisan
Can't find what you're looking for? Ask the community or share your knowledge.