Grasshopper

algorithmic modeling for Rhino

I have some curvesinto the grasshopper ,in contours array,and I feed the python component with them.Why don't I get the "x" variable as a list into the component although I feed the x variable with a list of curves???

Views: 360

Replies to This Discussion

There are no arrays in GH, there are data trees. Try to change the input hint of your python component to either list or datatree.

Hope that this helps.

Best,

M.

Wrong wording.Literally the output of contours component becomes the input of python component.So,my question,it's not a list into the python component?what is this?

thank you for your response

I would listen to Marios advice and change the "x" input's "Type hint".
It would be better if you would attach the .gh file too.

As you can see , I tried to offset a list o f contours.The obvious thing is that python component doesn't work like python editor.

thanks for your response

Attachments:

Hi Vasilis.
Your "x" input type was set to "float" instead of "ghdoc object".
To access a certain item from python sequence (list in this case) use the square brackets.
The rs.OffsetCurve works the same as in Rhino Python editor. The problem is that it returns a list. Then you append its result to "a" list - which makes it a list of a list. Grasshopper does not support that. So you need to either make a branch and add the list which rs.OffsetCurve returns to that branch, or just append all elements returned from the rs.OffsetCurve function to "a" list, on at a time.

Please attach your .3dm file too, next time. Thanks.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service