Grasshopper

algorithmic modeling for Rhino

Goodmorning guys,

I'm looking for a way to solve lists in python without using gh Tree System.

I've tryed a way, but i'd like to embed it in the py script.

Here is an example.
Have you ever tried it?

Views: 601

Attachments:

Replies to This Discussion

Anyone found a solution?

Hi Eduardo
Check the attached files.

Attachments:

Hi Naruto, thank you for the method but i was looking for a way doesn't use gh lib. Simply a cleaner way to avoid the trick of  ( a = x ).

A "clean" way would be to make a GH datatree in the script and populate it. See attached file..

Attachments:

It uses gh lib anyway. It's weird that, making grasshopper computing lists in series with an (a = x) is quite simple, but very dirty. And it seems there is no way to avoid a clustering to have just one component to appear.

Andreas' method is quite simple if we need a simplifyed data structure. But it doesn't if we use a more complex structure {A;B;C'...;n}, which is a structure coming from Python lists solving.

I don't see why it is "bad" to import the grasshopper assembly. If you're going to be making or modifying gh datatrees via scripting you are going to need it. You can make the datatree structure as complex as you like using the methods offered by the datatree class. To learn more about this I would suggest downloading the grasshopper SDK. All that said, it sounds like you can probably reduce your complexity by implementing whatever algorithm is making your definition so complex to whatever your Python script is doing (i.e. handle the complexity using nested loops and what not inside the Python component). But as always, easier to trouble shoot with a concrete example ;)

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