Thomas W Posted July 28, 2023 Share Posted July 28, 2023 Hello everyone, I am making a script to search in a spreadsheet, the script will need to run from a cell and the RunScript function. I had some problems and I would like to know if anyone has had similar problems: - after recalculating the spreadsheet either by right-clicking or by OIP the cell that contained the RunScript function is emptied, the function was no longer visible and the properties of the cell had changed, did you Have you ever had or seen this kind of behavior? Visible on the attached captures Be careful, the attached file can cause Vector to crash when running the script in the spreadsheet: RunScript in cell A59 All remarks will be welcome to understand what can be a problem. Thank you and good day! TW 14_PP 60 Simplifié V2.vso Test Plugin Menuiseries Extérieures 05 Simplifié V5+Script UUID et autres-V8 pour Forum.vwx Quote Link to comment
Thomas W Posted July 28, 2023 Author Share Posted July 28, 2023 Hi all, I will be on vacation for 15 days so I will take up this problem as soon as I get back and if I don't answer it means I'm not in front of my screen! Have a nice day or vacation everyone! Quote Link to comment
Thomas W Posted August 17, 2023 Author Share Posted August 17, 2023 Hi all, I hope the summer is going well for you! After a good break I plunged back into the worksheet scripts, I again had inconsistent displays but that I can't reproduce in an orderly way to be able to tell you the different steps to do to have the same result as on the attached screenshots. Have you ever had this kind of display after running a script in a cell with RunScript? (In the next message I will attach a .vwx file with different steps that make the contents of the cell where there was the RunScript formula disappear) Thank you and have a great day, Quote Link to comment
Thomas W Posted August 17, 2023 Author Share Posted August 17, 2023 Hi, I would like to understand what can create a display bug or who can delete the contents of cell A55 which contains the RunScript('GetWSSubrow....-V2) function. Short summary on the file: In the attached file there are 3 scripts, 2 scripts are executed in a cell with RunScript, the 3rd is executed by double clicking on it in the manager. On each database row, the Return UUID script returns the ID of the element according to the criteria. In cell A55 the script will look for identical UUID values to group them. The ClearWSCellBefore script run from the handler will check if rows are available for writing. By following the scenario below you should have the same thing as me, namely the content of cell A55 which contains runscript will be emptied while we are not acting on this cell: 1- Open the attached file, double click on the table and in cell A55 you should see =RunScript('GetWSSubrowCell...-V2') 2- Return the cursor to cell A60 (the tests were sometimes different by leaving the cursor on cell A55 (?)) and close the worksheet. 3-Run ClearWSCellBefore from the manager. 4-Go back to the worksheet and check the content of cell A55, the cell is empty and the format parameters have changed, there is no font size, some items are unchecked.. Does anyone know what can act in this way on a cell? Any ideas or leads? On 30-40 tests of this scenario I also had a blue fill appearing with huge line thickness in the cell like in the attached capture. With the scenario above and the attached file I did not have a crash. Thanks and have a good day! Test Plugin Menuiseries Extérieures 05 Simplifié V5+Script UUID et autres-V8 pour Forum - test erreur Runscript.vwx Quote Link to comment
Pat Stanford Posted August 18, 2023 Share Posted August 18, 2023 I followed your steps above and the formula in A55 remained. It still has the RunScript. VW2023SP6 Quote Link to comment
Thomas W Posted August 21, 2023 Author Share Posted August 21, 2023 Hello Pat, Thank you very much for testing! I tested on the post of a colleague and I had the same result, the contents of the cell are emptied. Below is a video where you will see what is happening. I can't figure out what's going on, I manage to reproduce it on my workstation since I don't save this file to keep the error, but the other times it happened it looked like random. Since this worksheet and this script will have to be used by several people, I will not leave the script in a cell but we will have to run it from the manager. By executing it from the manager I did not have any error of this type so we will keep this option, but I would have liked to understand where this behavior comes from on the cell. Thank you for your test and if no one has ever had this kind of behavior we will opt for a double click on the script in the manager to avoid errors of this type. we have this version in france 2023 SP5.1_IC_F4_(Build 702742) Have a great day 2023-08-21_09h31_05.mp4 Quote Link to comment
Pat Stanford Posted August 21, 2023 Share Posted August 21, 2023 I again followed your steps exactly and A55 was not cleared. I don't know how else to help since I can't see the problem. Possibly a problem with the French localization? Sorry. Quote Link to comment
Thomas W Posted August 22, 2023 Author Share Posted August 22, 2023 Hi Pat, No worries and thanks for trying again, I'll send it to the hotline, in the meantime we'll run the script from the manager, it'll work fine that way too! I'll report back when I get a response from the hotline. Have a great day, Thomas Quote Link to comment
Thomas W Posted August 30, 2023 Author Share Posted August 30, 2023 Hi, I got feedback from the hotline who managed to reproduce the problem without really knowing why it failed. For them it looks like a bug which could perhaps come from the numerous alert messages which interrupt during the execution of the script. There could also be a problem when multiple WS scripts run while one is still running. They'll pass it on to the developers at Vectorworks Inc. and I'll let you know if I get a response. Have a great day ! Quote Link to comment
Thomas W Posted September 14, 2023 Author Share Posted September 14, 2023 Hi, I received feedback from one of the developers at Vectorworks Inc. I am sending you an extract that may be of interest to some user : " The scripts as cell formulas should only calculate the value of this cell. If it is more complicated script that works on the entire worksheet should be a separate script in prinzip. " I solved the problems visible above by removing the script that was executed with the Runscript function and I compiled everything into a script that is executed by double clicking on it. The original goal was to put the script in a cell so that it would run whenever the user updates the spreadsheet, but this apparently isn't appropriate. Good day to all! 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.