hello,
I need to understand how vector work in rhino, for example Ihave got 2 points, to create a vector with it’s simple. vector=rs.VectorCreate(pt1,pt2), but now i want to modifi the lenth of the vector, i’ve got a distnace, an d i want to change only the lenth of the vector, but i want to keep the direction, is it possible?
to finish, i need to to apply the vector to points, to move them… but I don’t know how… i Wrote this code:
import rhinoscriptsyntax as rs
olinept1,olinept2=rs.GetLine()
a=True
target=(olinept1,olinept2)
longueur=1
vector=rs.VectorCreate(olinept2,olinept1)
while a:
vector=rs.VectorScale(vector,longueur)
target=rs.MoveObject(target,vector)
objects=rs.GetObjects('selectionne ce que tu veux aligner!!!!')
if objects:
pt1=rs.GetPoint('selectionne le point 1')
pt2=rs.GetPoint('selectionne le point 2')
reference=(pt1,pt2)
longueur = rs.Distance(pt1,pt2)+1500
for object in objects:
rs.OrientObject(object,reference,target)
else:
a=False
but target is not a list of point…