Jump to content

Help me schedule a task please


Recommended Posts

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

Link to comment

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 by mattao
Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...