Grasshopper

algorithmic modeling for Rhino

Hello

I am new to the VB programming in rhino, but I know the foundations of programming as I have done it in school several years ago.

I am trying to do the following: 

I have 3 different objects in Rhino (groups of curves) and I want to distribute them with the pattern in the ABBCABC format (I want to change the pattern later so I need it in string format).

I have managed to write the code to read the string (using case command) but I dont know how to copy and move the objects. How do I reference the curves? As BRep, curves, polylines or objects? This is what I have done so far:

 

Dim move As New Vector3d
Dim textLen As Integer
Dim i As Integer
Dim ch As Char

Dim proba As String

Proba = " "

move.X = 0
move.Y = 0
move.Z = 0

textLen = Len(text)

For i = 1 To textLen
Dim t(i) As curve
ch = Mid (text, i, 1)
move.Y = i * d
Select Case ch
Case "A"
t(i) = A.duplicate
A.Transform(transform.Translation(move))
proba = proba + "*A"
Case "B"
proba = proba + "*B"
Case "C"
proba = proba + "*C"
End Select

print(proba)

Next


I have to add that this function (transform.translation(move)) didn't give any results.

Thanks in advance

 

Views: 428

Replies to This Discussion

OK, so I have done it with regular GH with some VB (to read the string), but for learning purposes I would like to know how can I do this with VB.

Can someone help? thanks

This is the definition that I want to write in VB (without the orient or rotate)

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service