Grasshopper

algorithmic modeling for Rhino

Hello,

is there a way to get "0" from "List Length" command, if it is empty, instead of "no data was collected"? Eventualy, how do I convert it? I need a number. Thanks a lot.

See picture attached.

Views: 1100

Replies to This Discussion

picture:

Attachments:

Do you actually have an empty list or is there no data at all?

--

David Rutten

david@mcneel.com

Tirol, Austria

Attached a VB script that returns zero for both empty lists and non-existent lists.

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

Thanks!

But I didn't explain my problem cleary enough. I need something as "if function": If list length returns no data (is empty), I need zero output. But if it contains data and returns number, I need the number. So I ether want number (4 for instance) or 0.

Thank you!

Well, instead of using List Length plus some conditional, just use the VB component instead and you're done right?

--

David Rutten

david@mcneel.com

Tirol, Austria

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service