FranAJA Posted February 10, 2023 Share Posted February 10, 2023 (edited) Hello everyone, can someone help me to find nice resources to start the study of python in VW, (like tutorials etc) ? Sadly I did not find anything into vw university, I would like to start from the beginning. I know python already a little just fundamentals, but I can not do too much by my own without any other resource. Thank you in advance. Edited February 10, 2023 by FranAJA Quote Link to comment
Pat Stanford Posted February 10, 2023 Share Posted February 10, 2023 There is nothing that I know of that is like a course in Python for VW. Your best bet is to pick a relatively simple project (ask here to make sure your idea of simple is actually simple) that will have some value for you. Then look at some of the sample code in this forum and start asking questions. We are a friendly bunch of crazies and there are numerous people who will chime in to help. There is even more Vectorscript code that uses the same functions as Python (actually Python uses the VS functions), so don't be afraid to look in the Vectorscript forum either. The syntax is different, but the code is similar. Welcome to the club. HTH 1 Quote Link to comment
FranAJA Posted February 13, 2023 Author Share Posted February 13, 2023 Dear Pat, Thank you very much for your help. I have started to see something on the wiki-like developer page, and let's say it is starting to make more sense, it is just a matter of knowing more the different modules of VW API. It will be amazing if in the future someone could make a proper tutorial (just simple script) in University. Quote Link to comment
Pat Stanford Posted February 13, 2023 Share Posted February 13, 2023 Keep asking here as you have questions. I keep pretending I am going to write a book called "An Outsiders Guide to the Inside of Vectorworks" and try and document a lot of the things that make scripting VW challenging. But not sure I will ever get to it. 😞 Quote Link to comment
Elite Exhibits Posted February 13, 2023 Share Posted February 13, 2023 Pat In a previous life - with an application call Cadvance (i believe) there was a way to record what you did as a script - then view it and edit it - This gave you the basis of simplifying some of the programs complexity, without the need to understanding a programing language. Any way to record a script in VW as a starting point ? Peter Quote Link to comment
Pat Stanford Posted February 13, 2023 Share Posted February 13, 2023 No real "recording" mechanism. But that would be a good request for the wish list. If you are creating objects, you could draw what you need and then Export Script from the Export menu. This will give you the basic Vectorscript needed to draw what you have created. But it will use all absolute values, not variables. But at least it is a starting point some times. But you need to figure out what parts of the code are generated as default drawing setup and ignore those and only focus on the parts of the code for what you drew. Do this in a new blank file, not as part of a huge project or you will spend your life trying to find the parts that represent the object you are lookin for. Quote Link to comment
MullinRJ Posted February 13, 2023 Share Posted February 13, 2023 Hi Peter, Asked for many times, never developed. The only way to peek under the hood, is to draw something, then "Export Script..." under the File menu. It does not give you the progression of steps you are looking for, but only a static snapshot of the drawing state at the time of export. There is a lot of clutter that you can ignore at the top and bottom of the file. I typically search for "CreateLayer(" and look for the layer name you expect to find your object(s) of interest. If your file is complicated with many objects, and/or many layers, copy your object(s) of interest to a blank file and Paste_In_Place, then Export Script from that file. It will make finding your target code a lot easier. Not sure if this helps, 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.