Hippocode Posted April 3, 2013 Share Posted April 3, 2013 (edited) Looking for a way to let a PIO recalculate itself trough another script. Yes with SetRField we can change parameters, and even "calculated parameters" but hence it would be so much easier if the last one is done by the PIO. My current workaround: Right now i've set the PIO properties to reset on rotate, in my script I let the object rotate 0 degrees, the reset works fine and for this PIO its great because I never need to rotate it. Does anyone have a better workaround ? I don't like using the rotation event Edited April 3, 2013 by hippothamus Quote Link to comment
Vectorworks, Inc Employee Matt Panzer Posted April 3, 2013 Vectorworks, Inc Employee Share Posted April 3, 2013 Will RestObject(pioHandle) do what you need? It will force a PIO to regenerate. Quote Link to comment
Vectorworks, Inc Employee Matt Panzer Posted April 3, 2013 Vectorworks, Inc Employee Share Posted April 3, 2013 Correct. The PIO won't update until after your current script finishes. Are you saying that setting it's rotation (with the PIO set the reset on rotated) will trigger the PIO to update while the dialog is open? If so, a similar approach might be to have it reset on move and move it by (0, 0). I haven't tried this via script, but I use the same technique to manually force PIO to update. Quote Link to comment
Hippocode Posted April 3, 2013 Author Share Posted April 3, 2013 Correct. The PIO won't update until after your current script finishes. Are you saying that setting it's rotation (with the PIO set the reset on rotated) will trigger the PIO to update while the dialog is open? If so, a similar approach might be to have it reset on move and move it by (0, 0). I haven't tried this via script, but I use the same technique to manually force PIO to update. Sorry deleted my earlier post. I've got something weird going on that some of the data is changed right away, others after closing the listbrowser. Going to test some more before commenting Quote Link to comment
Hippocode Posted April 3, 2013 Author Share Posted April 3, 2013 (edited) Correct. The PIO won't update until after your current script finishes. Are you saying that setting it's rotation (with the PIO set the reset on rotated) will trigger the PIO to update while the dialog is open? If so, a similar approach might be to have it reset on move and move it by (0, 0). I haven't tried this via script, but I use the same technique to manually force PIO to update. Allright I've got 3 problems: One: the object needs to be updated AFTER I close the Listbrower. This is done trough the rotate 0 degrees and "reset on rotate". (solved) My list browser shows some paramaters that are calculated by the PIO. The list gives the option to change the subparams and i'm looking into getting the NEW calculated param into the listbrowser without hardcoding the same formula My listbrowser shows parameters that are instantly changed trough a popup. This works on everything besides booleans. The changes only get affect on closing the listbrowers, not on closing the popup. While the normal "strings/integers" are changed instantly Doesn't make sense to me. Why can't I directly update Booleans ? Edited April 3, 2013 by hippothamus Quote Link to comment
Vectorworks, Inc Employee Matt Panzer Posted April 3, 2013 Vectorworks, Inc Employee Share Posted April 3, 2013 Ok. So the PIO does NOT update any parameters in the dialog while it's open. For a moment, I thought you managed to get some to update. I think there's no good way to do this because of the serial nature of vectorscript. One script must complete before another script can run. This is a long shot, but if what you're trying to do can be done through a worksheet database (rather than a dialog), you might get what you need that way. Otherwise, I've got nothin'... Quote Link to comment
Hippocode Posted April 3, 2013 Author Share Posted April 3, 2013 (edited) Ok well I'd like to keep it with a listbrowser. Eventually its possible to hardcode the calculated params so there is a way around it. The booleans were my own fault, didn't reset them Edited April 3, 2013 by hippothamus Quote Link to comment
JBenghiat Posted April 3, 2013 Share Posted April 3, 2013 I think your best option is to put the calculation code into a procedure or function in an include file. That way you write (and can revise) the calculation code once, but you can use it anywhere you wish. -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.