Grasshopper

algorithmic modeling for Rhino

Grasshopper python: Bestway to stop a datatree as an input

Hi Everyone,

I want to put a check in my grasshopper python component so that if what you see in the picture below happens - that is a datatree is entered as an input to the component.

The component will identify that its a datatree and then raise an error.

Essentially I dont want datatrees as an input in my component. So the question is what would be the best way to code a check so that I could raise an error if a datatree is used as an input?

Views: 356

Replies to This Discussion

You've got different options:

- Use datatree as input type and flatten the input using python to use it as a list internally.

- Check if the amount of iterations is larger than one and throw an error.

- Use datatrees and check if the amount of branches is larger than one.

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