Jump to content

Resources for Python scripting in VW


FranAJA

Recommended Posts

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 by FranAJA
Link to comment

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

  • Like 1
Link to comment

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.
 

Link to comment

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

Link to comment

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.

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...