Nik Posted October 7, 2016 Share Posted October 7, 2016 (edited) Having trouble getting vectorscript functions that require a vector as parameter to work properly. In the snippet of code below, I think that ang should equal 45°. But the dialog tells me -90° and then I get the error shown in the attached file: pt= [1,1] ang = vs.Vec2Ang(pt) vs.AlrtDialog(ang) Edited October 7, 2016 by Nik Quote Link to comment
JBenghiat Posted October 7, 2016 Share Posted October 7, 2016 From the developer.Vectorworks.net: If Vect is {0,0,0}, Vec2Ang returns -90. Your vector input is incorrect, so you are getting the default return value. Vectors represent three dimensional space, so require three points. If you are dealing with a plane, just use 0 as the z coordinate. Also, vectors are represented by a tupple, not an array. So what you want is: pt = (1, 1, 0) -Josh Quote Link to comment
Nik Posted October 7, 2016 Author Share Posted October 7, 2016 Awesome! Making the switch from vectorscript to python is a bit of a challenge! 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.