ladybug-tools / ladybug-legacy

:beetle: Ladybug is an environmental plugin for Grasshopper.
http://ladybug.tools
Other
194 stars 82 forks source link

Unable to append point to list in ghpythonlib Library #445

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi all,

I'm new to scripting in GH using Python. I decided to try out the ghpythonlib.components library to perform a simple point cloud simulation but I am unable to find the equivalent command for append to list in the library. Everytime the code runs only the most recent point gets printed. I want them to be stacked in a list.

Kindly someone please help me out. image

chriswmackey commented 6 years ago

@demi12395 , I realize that it's not totally obvious from a google search where your question belongs but the Ladybug legacy github is definitely not the right place. For all of your general python questions like this one, you should be searching stackoverflow, where you would find that the right way to append to the list is the following:

a = []
for i in range(10):
    a.append(i)

For anything specific to GHPython, the right place is the scripting section of the Grasshopper website: http://www.grasshopper3d.com/forum/categories/vb-c-and-python-coding/listForCategory