mcneel / ghpython

A Grasshopper component for Rhino.Python
http://www.food4rhino.com/project/ghpython
117 stars 34 forks source link

ghenv.Component.Exposure is read only #60

Closed mostaphaRoudsari closed 10 years ago

mostaphaRoudsari commented 10 years ago

I'm trying to automate the process of creating/updating userobjects and I noticed that Exposure is a read only properties. Is it possible to change this so one can change the component exposure?

piac commented 10 years ago

This property of the Grasshopper SDK is meant as something to be inherited, not as something to be dynamically changed. What are you trying to do exactly? What do you mean by "automating creating userobjects"? It seems that what you are trying to do might be useful, but this is not the way to address it.

piac commented 10 years ago

Please feel free to keep the conversation going

mostaphaRoudsari commented 10 years ago

@piac I was writing a component based on your component that iterate between all the components in the file, read the source code, and if the source code is newer than the current version exports the source code and creates a new userobject. I wanted to have the exposure set inside the file so the new userobject ends up in the right position. I just used one of the other properties instead: https://github.com/mostaphaRoudsari/ladybug/blob/master/src/Ladybug_Export%20Ladybug.py#L132

It works fine. Thanks for your explanation.