Jump to content

different version of vs class?


Recommended Posts


I have a Vectorscript tool (not Event driven 2024). This tool rund a python module. The tool is working so far.
code of the tool

PROCEDURE ClickCallback;
	x1, y1 : REAL;
	path : STRING;

GetPt(x1, y1);
PythonExecute('import dev.tool.mod.poly2PIO');

RUN( ClickCallback );

the module poly2PIO runs this code:

import vs
import os
#vs.SetPref(412, True) #turn off caching


with open(os.path.expanduser('~') +'/file_vst.txt', "w", encoding='utf-8') as f:
# error here isOnLine undefined method   
isOnLine = vs.PtOnLine((0,0), (-10, 0), (10, 0), 0.00001)

everything and also vs.PtOnLine() is working. If i use that tool.

But then, if i run run another vso (Event Enabled path object) it seems that the vst does not have the same vs-function anymore as before.
Also if i use a standard vso (Script Based like the Rolling Stairs) the vs class in my vst do not contains the same methods anymore.


import vs
#from datetime import datetime
import json
import math
import copy
#import uuid
import os
import base64
import time
#import urllib.request
import code.common.controler as controler

#vs.SetPref(412, False)  # turn off caching

with open(os.path.expanduser('~') +'/file_vso.txt', "w", encoding='utf-8') as f:

The functions in the  vst does not work anymore. Also other vst's have the same issues now. 

The special thin i do is, that i run a pascal script and call a python after i click in the drawing. For further debug i write a text file with dir(vs) which lists all methods of the vs class.

If i then compare the two files, i can see, that the dump written from file_vst.txt has much less methods available (left) as the file dumped from the vso?
Somebody knows if this is a normal limitation or if it is worth for further diving in? 

I think not many devs wrapps a pascal around a python script so maybe this is a normal limitation that the methods freezed on a specific version or it is just a bug?

It looks some-like, that methods after 2014 are not included now for my vst. 
Anybody knows what could going on?

Here a screenshot from the method list compared with diff Merge

Edited by DomC
Link to comment
  • DomC changed the title to different version of vs class?

I would say maybe a rookie error:

#allowed >> produces no errors caching is off
vs.SetPref(412, True)  # turn off caching

#don't do that >> seems to breaks the vs modul or ignore newer methods
vs.SetPref(412, False)  # turn off caching

#allowed >> produces no errors caching is on
#vs.SetPref(412, True)  # turn off caching


  • Like 1
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.

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...