Grasshopper

algorithmic modeling for Rhino

Hello,

How can I select all the geometry in my grasshopper file using python? It isnt baked into rhino it only exists in the gh canvas.

Example - I've made a simple model - it's has separate geometry elements being: floor, walls, window and ceiling. I now want to rotate these items using like...

For geometry in allgeometry:
Rs.rotateobject....

(To keep my code neat and concise I don't want to have to select each item and rotate - I want to select all geometry and rotate. )

Is that possible?

Thanks.

Views: 650

Replies to This Discussion

Not sure if I properly understand the question but I think you can append all your geometry together and then rotate the whole list without having to loop through it. 

Attachments:
Thanks for replying. It isn't what I'm after though.

I want to be able to select all objects using python code. Because I've made the items using code the nodes you'veshown do not exist. I could output the element to nodes then input into a new node, but that defeats the point of making my code concise. Thanks for contributing though.

Grasshopper has no document-driven concept of selection and GhPython does not have it either. This is mostly because picking is a non-easily repeatable operation.

What are you trying to do?

Hello giulio,

I've written a dynamic script that makes a room with any number of windows and shading devices (to be eventually passed into honeybee for calculation). The elements need to stay separate for material grouping.

At the moment I have script that selects each element - it works fine but there a lot of repetition hence I was hoping there was a method to simply 'select all grasshopper elements'

Hi again John,

please be a little more specific: I would need to know where the "dynamic script" is working, is it in Rhino or GH? And the script you are writing? What do you mean by "elements need to stay separate for material grouping"?

What kind of "repetition" is there? Why is it there in the first place? Could it be prevented rather than cured later?

Sorry for coming back with more questions than answers,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service