i’m trying to move an object on only one or two axis, for example move on XY or XZ etc…
i thought leave blank a number ( , 10 , 10 ) or use ( null , 10, 10 ) in my arrEnd , but of course that didn’t work , it seems rhino need 3 coordinates anyway.
How can i do ?
Thanks.
Call Main()
Sub Main()
Dim strObject, arrStart, arrEnd
strObject = Rhino.GetObject("select Object to move")
arrStart = Rhino.GetPoint(" select point")
arrEnd = array(, 10, 10)
Rhino.MoveObject strObject, arrStart, arrEnd
End Sub
Yes, you’ll need to just create a transform from your vector like below and can get rid of a start point:
Option Explicit
Call Main()
Sub Main()
Dim strObject, arrVector, arrXForm
strObject = Rhino.GetObject("Select object to move")
If IsNull(strObject) Then Exit Sub
arrVector = Array(10, 10, 0)
arrXForm = Rhino.XformTranslation(arrVector)
strObject = Rhino.TransformObject(strObject, arrXForm)
End Sub
It basically does the same as my second code snippet above.
It also could be simplified a little passing the vector directly to Rhino.MoveObject()
Option Explicit
Call Main()
Sub Main()
Dim strObject, arrVector, arrXForm
strObject = Rhino.GetObject("Select object to move")
If IsNull(strObject) Then Exit Sub
arrVector = Array(10, 10, 0)
strObject = Rhino.MoveObject(strObject, arrVector)
End Sub