mattao Posted March 15, 2016 Share Posted March 15, 2016 Hi I'd like to program a python script to act every 5 minutes. Meanwhile he is sleeping i'd like to be able to do something else. I've downloaded web link image, it works perfectly. I'd like to add a button to Autoupdate the image every 5 minutes if the object is selected. How to do that? Thanks Quote Link to comment
michaelk Posted March 15, 2016 Share Posted March 15, 2016 I don't think you can run two scripts at once. If you're using a mac, you can insert vector script or python into an apple script that triggers on a time schedule. Not sure if that will get you around the two scripts at a time problem… mk Quote Link to comment
mattao Posted March 15, 2016 Author Share Posted March 15, 2016 (edited) Thank you michaelk I was looking to do that inside the python script using a sched or time event. I used time.sleep (300) but doing that Works freeze until the 300 seconds are complete. ( not what I am looking for.) Edited March 15, 2016 by mattao Quote Link to comment
michaelk Posted March 15, 2016 Share Posted March 15, 2016 I was talking about using the macintosh apple script to do the timing. So the script would run every five minutes, but in-between Vectorworks wouldn't know that the apple script was running. Here's an example of a ridiculous script that animates a door opening. It's a vector script running inside an apple script. https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Main=41994&Number=208989#Post209019 mk Quote Link to comment
mattao Posted March 15, 2016 Author Share Posted March 15, 2016 Hi think you just gave me the exact thing I needed. Thanks Quote Link to comment
mattao Posted March 15, 2016 Author Share Posted March 15, 2016 Ok the script you provided works fine, and I think it will do what I need. Is there a way to trigger a PIO event from applescript? Or from python? My PIO as a button on the info palette that trigger a specific script. I'd like to auto trigger this script every 2 seconds. Quote Link to comment
mattao Posted March 15, 2016 Author Share Posted March 15, 2016 I got to add i succeed in what I was looking for just by Refreshing my PIObject through a modified version of your script. But I didn't learn how to trigger a PIO event from applescript or python so I still hope an answer. Thanks Quote Link to comment
JBenghiat Posted March 15, 2016 Share Posted March 15, 2016 ResetObject() will cause a PIO to regenerate, which may very well be what the button does. If you are trying to trigger a specific button in the PIO, you can't do that with a script. Keep in mind that Python and VectorScript always run in the foreground, so you're going to get a slight interruption every two seconds. If you are in the middle of a drawing operation when the script fires, it could be interrupted. -Josh 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.