Grasshopper

algorithmic modeling for Rhino

I have a point list, and  i would like to use rs.Addtextdot from python in grassphopper for those point (line 48 in python). but it's not working there is an error in python. I was wondering how could I do it.

Views: 1512

Replies to This Discussion

Hi Liu,

As the error message says: Grasshopper does not support an annotation text dot objects.

You can use it in the "Rhino Python Editor", though.

so I how could I add text dot if I like to use it in python grasshopper?

Try feeding the Grasshopper's component "Text" with strings and points from Python output component:

import rhinoscriptsyntax as rs
import random

# empty output lists
ij = []
pts = []

for i in range(x):
    for j in range(y):
        # generating string
        text = "(" + str(i) + "," + str(j) + ")"
        ij.append(text)
        # generating point
        x = random.randint(0,20)
        y = random.randint(0,20)
        pt = rs.AddPoint([x,y,0])
        pts.append(pt)

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service