Jiajing Posted February 25, 2022 Share Posted February 25, 2022 Hi all, I am writing a python script, however any lines after line 810 can not be saved. When I click OK and exit script editor, all script after line 810 disapperaed. I am using VWX2022, most updated version. Any thoughts? Thank you Quote Link to comment
michaelk Posted February 25, 2022 Share Posted February 25, 2022 That's very strange. I usually use vector script and exceed 810 lines often. Just tried it with python and I had no trouble with 1300 (totally fake lines). Quote Link to comment
MullinRJ Posted February 25, 2022 Share Posted February 25, 2022 In Vectorscript there is a 32K limit to the amount of text the Script Editor can hold for scripts stored in a Script Palette. One way around it is to use an $INCLUDE statement in the script's main text body to reference the script's external location for the Pascal compiler. The compiler can handle much more than 32K bytes. It may be that you've run into the same text size limit in your Python script. Using an external editor check the size of your 810 lines to see if this is true. If it is, you will have to break you script into smaller chunks and import them into the main script. Raymond 2 Quote Link to comment
Pat Stanford Posted February 25, 2022 Share Posted February 25, 2022 Especially if working on PIOs, having the base script be nothing but an $INCLUDE of an external document that you can edit with an external editor is the better way to work. It saves you multiple steps to be able to get back to the script to edit. Just make sure you have Run Scripts in Developer Mode selected in the Session panel of Vectorworks Preferences. This will force the script to compile on every run so it will import any changes you make in the external editor. 3 Quote Link to comment
The Hamma Posted February 25, 2022 Share Posted February 25, 2022 I am curious. I see how the $include command can be used to run a vectorscript sub script but I have a python script that I would like to run as a subroutine in a vectorscript. Can this be done? Quote Link to comment
Pat Stanford Posted February 25, 2022 Share Posted February 25, 2022 PythonExecute There are samples on the Developer site that are not in the local function reference. https://developer.vectorworks.net/index.php/VS:PythonExecute 1 Quote Link to comment
Jiajing Posted February 26, 2022 Author Share Posted February 26, 2022 7 hours ago, Pat Stanford said: PythonExecute There are samples on the Developer site that are not in the local function reference. https://developer.vectorworks.net/index.php/VS:PythonExecute Thank you, Pat. I will look it up. 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.