Jump to content
Sign in to follow this  
mattao

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...