Ben Wingrove Posted May 28, 2015 Share Posted May 28, 2015 I hope someone can help me, I have been playing round with creating scripts. On some of my saved views I want to run a fit to window script as I have different sized monitors. I created a simple script using python vs.DoMenuTextByName('Fit To Window') when i choose the saved view the script works as it should but I get the following error Error: Invalid number of parameters to the callback function. : index = 1 name=index File "", line 1, in File "", line 1, in I have been trying to find a solution to this for most of the day now and it is driving me crazy, any help will be greatly appreciated Thanks Ben Quote Link to comment
Miguel Barrera Posted May 28, 2015 Share Posted May 28, 2015 I believe you are missing the index number: def vs.DoMenuTextByName(subMenu, index): return None Try vs.DoMenuTextByName('Fit To Window',0) Quote Link to comment
Ben Wingrove Posted June 3, 2015 Author Share Posted June 3, 2015 Thanks Worked like a charm, I also noticed I still had "Restore Zoom and Pan" checked so that was overriding the script. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.