Grasshopper

algorithmic modeling for Rhino

I've been developing some custom components, but I've been unable to use the GH_DocumentObject.Exposure property. Any ideas on where this needs to applied in the code, and moreover, since its a read-only property, how does one 'set' the Exposure.

Its probably very trivial for those who've figured this out, but any help is greatly appreciated.
Many Thanks!


Views: 429

Replies to This Discussion

Hi Suryansh,

you cannot set the Exposure, so you must override the property and return a constant exposure.

If you're using VB, just type "Overrides" inside your object class and pick the Exposure property from the dropdown list. Then you must return one of the Exposure enumeration flags.

Public Overrides ReadOnly Property Exposure() As Grasshopper.Kernel.GH_Exposure
 Get
  Return GH_Exposure.primary
 End Get
End Property


--
David Rutten
david@mcneel.com
Poprad, Slovakia
In C#, use the following:

public override GH_Exposure Exposure
{
  get { return GH_Exposure.primary; }
}


--
David Rutten
david@mcneel.com
Poprad, Slovakia
Perfecto! Thanks!

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