Hey there!
I trying to make a python script that takes the X and Y from a list of vector’s and decides the rotation for each vector direction. I created this script in the Visual Studio and it’s working there, but when I tried to run in the python script node in the DYNAMO I always get a Empty List.
Why I get this Empty List?
This is the dynamo script:
And this is the Python Script:
# Carregar as bibliotecas DesignScript e padrão do Python
import sys
import clr
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# As entradas para este nó serão armazenadas como uma lista nas variáveis IN.
X = IN[0]
Y = IN[1]
angle = []
c=0
# Insira o código abaixo desta linha
for i in X:
if X[c]>0 and Y[c]==0:
angle.append(90)
if X[c]==0 and Y[c]>0:
angle.append(180)
if X[c]<0 and Y[c]==0:
angle.append(270)
if X[c]==0 and Y[c]<0:
angle.append(360)
c+=1
# Atribua a sua saída para a variável OUT.
OUT = angle