Grasshopper

algorithmic modeling for Rhino

Hello,

I have a question on displaying multiple lists at once in a python script. If I display one list, the objects are shown. However when I want to show two lists (see Lists in list picture) the error IronPython.Runtime.List is shown and no objects are shown, even the objects from the first list aren't displayed. Is it possible to show multiple lists at once as 1 python output.

Thanks in advance,

Roman

 

Views: 870

Attachments:

Replies to This Discussion

Search the forum for DataTree or how to convert list of lists to datatree.

I searched the forum for DataTree but the most I can find is with respect to VB or C# and not for python. The few discussions with respect to python I don't understand, for instance the GH_path.

I already have several lists and now I want to put all these lists together so I can display them on the Rhino interface. So therefore I don't have to use the "for i in range...." (I guess) that are shown in several explenations. Is there not an easier way to combine several lists in 1 list and avoid the error of the Ironpython.Runtime.list?

 

You have to create a tree, because Grasshopper will not attempt to parse nested collections.

Creating trees isn't too difficult, you should be able to just append each list using The AddRange method on DataTree, while creating a new GH_Path each time. However I do not know how (or even whether) python supports trees.

Thanks David it works. With your explanation in combination with the explanation on

 

http://cu.t-ads.org/?p=399 (University of Tokyo)

I managed to script it. Many thanks

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service