BillW Posted September 14, 2023 Share Posted September 14, 2023 Recently I moved to Notepad++ for coding and have a full environment geared to Vectorscript. If interested, information can be found at http://www.whwsolution.co.uk/tag/vectorscript select post “Vectorworks: Notepad++ for Vectorscript” - download documentation PDF "notepad for vectorscript" for information on implementation/installation. - download "notepad plus extras.zip" file - unzip in your prefered location on your computer - copy the following files to your Notepad++ installation directory as indicated. Any problems drop me a line at info@whwsolution.co.uk Find enclosed two flyer images giving an idea on the implementation. The Notepad Pythonscript plugin allows extending of the environment which is impressive. It was a good exercise to understand how regex works in Python. 4 Quote Link to comment
Thomas W Posted September 14, 2023 Share Posted September 14, 2023 Thanks a lot for sharing and the work that it represents! I will test as soon as possible and get back to you Quote Link to comment
Thomas W Posted September 14, 2023 Share Posted September 14, 2023 @BillW The installation of the whole thing went very well following your pdf file and the auto-completion plus the advantages of snippet codes and quicktext is really a plus! I haven't tried Python scripting because I don't have enough knowledge in this language but the possibilities look interesting. Thanks again for sharing! Quote Link to comment
BillW Posted September 30, 2023 Author Share Posted September 30, 2023 I have just updated the autocompletion file "pascal.xml" for Vectorscript 2024. Find enclosed amended file. Replace existing file in folder "notepad plus\autoCompletion" Calls added are: CreateBorderlessBtn CreateBorderlessMenu CreateDataVisPDMenu GISDimStringToMM GetProjectElevation IFC_GetStructureGUID IFC_ReadProjectData IFC_SetStructureGUID IFC_WriteProjectData IsResourceReferenced SM_FromShape SM_Preferences SetProjectElevation Space_FullyReset Any problems drop me a line at info@whwsolution.co.uk pascal.xml 1 Quote Link to comment
Thomas W Posted October 9, 2023 Share Posted October 9, 2023 Hi @BillW, Thanks for the update and this information! In France we are currently on version 2023 SP6, so I would use it as soon as version 2024 is available. Thank you and have a nice day Quote Link to comment
Mike Rock Posted February 8 Share Posted February 8 @BillW Thanks for taking the time to create, document, and share this, I've been using it for the last couple weeks and found it very helpful. A (possibly) silly question - is there a better work flow than copying and pasting the code back and forth between VW and Notepad ++? Using the Text File option in the script editor pulls it once but my ideal workflow would to be able to have the code refreshed each time the editor is open. Any suggestions to be able to quickly push the code from Notepad ++ to VW? Quote Link to comment
BillW Posted February 8 Author Share Posted February 8 Don't think there is an automatic way although I stand to be corrected. But, in, for instance a plugin object, you could have the code content referenced by {$INCLUDE <codefilename>.px} (contained in the user Plug-Ins folder) which references the code file in Notepad and setup developer mode but you'll still have to "Recompile the script" I believe. You can also specify a pathname for the file. ie {$INCLUDE C:\Projects\Vectorworks\mytool\source scripts\mytool.px} I'm old school and prefer to copy/paste to the Plugin Editor. I sometimes do not immediately save a file in Notepad but wait till I get things working. If things don't work I reload the file in Notepad and start again. Been using Notepad for quite a while. I use Notepad Pascal language option much of the time (rather than Vectorscript User Defined Language) as the Function List tab displays the file routines. Although I do have a script to swap languages. Quote Link to comment
Pat Stanford Posted February 8 Share Posted February 8 {$INCLUDE is the best way. In the past (not certain about now), the VS Editor had a character limit of 32,000 characters. If you were working on a big project you had to use $INCLUDE to get all the code to compile. And you only need the .PX file extension if you want to Encrypt the file. You can us .vs, .text, or basically anything you like if you don't mind that part of the script not being encrypted. For the few files I have encrypted, I used .vs for development. And then when I was ready to encrypt I duplicated everything, changed the extensions on the files and in the $Include lines. That way I knew I had an unencrypted version to fall back on. Quote Link to comment
MullinRJ Posted February 8 Share Posted February 8 (edited) You can use $INCLUDE statements in Palette Scripts, and in Plug-in Scripts. You can also set VW to recompile on each execution (VW Pref 21 – Developer Mode, or VW Pref 407 – ImmediateVSMode), but it is only "automatic" for scripts run inside Plug-ins. If you want to recompile a script that has an $INCLUDE statement in a Palette Script, then after you make changes to the disk file you will have to open the Script Editor for the script in the palette (Opt/Alt–Double Click) and then close the Editor with the OK button. No changes to the file are necessary. If you use the ESC key or click the Cancel button, nothing happens and the script will not be recompiled. If you have your $INCLUDE statement inside a Plug-in and set VW to recompile for each execution, VW will automatically recompile before each execution, so you can make edits in your disk file and rerun the Plug-in. Your disk changes will be recompiled. Bottom Line: The Automatic Recompile option for Palette Scripts is meaningless. It only applies to Plug-in scripts. HTH, Raymond Edited February 9 by MullinRJ Typo - changed Pref 12 to Pref 21. Quote Link to comment
Pat Stanford Posted February 8 Share Posted February 8 5 hours ago, MullinRJ said: Bottom Line: The Automatic Recompile option for Palette Scripts is meaningless. It only applies to Plug-in scripts. I actually think this is a bug. I believe that Developer Mode is supposed to recompile scripts as well as PIOs. And I have actually had problems in VW2024 and 2023 where it was caching the compiled version of a script even after editing it. The work around I came up with was to Select and Cut the script, close the editor, open the editor and Paste. Very annoying. But are you certain that SetPref(12) is Developer mode? According to the Appendix, that is Log Time in Program. 21 is Stop Vectorscripts on Warnings. 1 Quote Link to comment
Mike Rock Posted February 9 Share Posted February 9 Thanks folks - the code on the VS side is a single line '{include...' Saving the Notepad ++ file and recompiling the script is very helpful, now I can take advantage of more features of notepad ++ like bookmarks. 1 Quote Link to comment
MullinRJ Posted February 9 Share Posted February 9 Hi @Pat Stanford, OOPS! Yes, Pref 21, not 12. Thank you. I corrected it above. It may be a bug, but as far as I can remember it has always worked this way. Annoying, it is! If you can get it scheduled to be "fixed", I and a lot of others will rejoice. Raymond 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.