Grasshopper

algorithmic modeling for Rhino

Hi all,

Does anyone knows how can I hide (turn off the preview) of one of the outputs of GHPython component?

I want to register the geometries but don't have them in the preview. I couldn't find any method from ghenv.Component.Params.Output.

Thanks,

Mostapha

Views: 1571

Replies to This Discussion

Hi Mostapha

the "preview-disabled" property is called "Locked". Assuming there's one output,

ghenv.Component.Params.Output[1].Locked = True

should do.

(Trick: to introspect variables from the previous iteration with autocompletion, you can use ghenv.LocalScope.name_of_variable. This is how I quickly found what was available in Output[1]. Later you can remove "ghenv.LocalScope")

Giulio

--

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

That's actually not true. Locked is the word the SDK uses for Enabled. Not all parameters have preview settings as not all parameters can draw a preview (text, booleans, numbers, domains for example). You have to cast the output parameter to an IGH_PreviewObject and then you can say Hidden = True.

--

David Rutten

david@mcneel.com

Tirol, Austria

Ops, my bad. It should have read, as David mentions:

ghenv.Component.Params.Output[1].Hidden = True

There is no cast in Python, so this will work as long as the parameter actually has the Hidden attribute - which it does.

Giulio

--

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

Awesome! Thank you both. - Mostapha

Hi,

Has this option changed "lately"?

The Hidden=True is not working for me, even though it used to.

I noticed that the "Hidden" attribute doesn't show, but i can see what could come instead.

Will appreciate your help.

-A.

Hi Abraham

I just checked Rhino 5 (SR12 64-bit) and WIP (6.0.16152.9051) and both seem to work with this definition.

I did notice that Rhino WIP is somehow caching preview status, so you need to run the definition twice (push F5 after switching to true).

I hope this helps,

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

Attachments:

Thank you Giulio.

Works fine also for me.

Best,

-A.

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