Grasshopper

algorithmic modeling for Rhino

Hi!

I have a very simple problem:

I import some points (for now, just 6) from rhino into the normal point parameter in GH ('set multiple points') and take these into my pyhton script.

However, I cannot seem to grasp how these points are presented into the Python-component. when i print the 'pts' (line 5) i am only returned 1 point. however, when i draw a line from this(/these?) point(s), a line is clearly drawn to EVERY single point.

It seems like the points are grafted to a tree, but i still cant seem to append them to a new list.

How do I import the points as a simple list variable? (I tried right-clicking 'points' input and set 'list access' and 'tree access' and various type hints, but none worked.)

Does python import one point at the time and the run the script x times, or why does this happen?

Is there btw. a python-command for flattening the input/output?

Thanks in advantage

- Lasse

Views: 2670

Replies to This Discussion

Hi. if you use item access your script working step by step separately for every point, therefore you see only one point when try print it. if you use list access, your points variable is a list object (with all points inside), and if you use tree access your points variable is a data tree object (points + path inside ). It's meen you need use list access, but your script will not work, because rs.PointCoordinates and rs.AddLine functions are waiting item objects, not list. use these functions inside for loop.

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