Grasshopper

algorithmic modeling for Rhino

Hi, I am looking for the class to change gh object display color. Does this class exist? 
Thanks

Views: 3098

Replies to This Discussion

Hi raf,

 

preview colours are stored as document properties on the Grasshopper.Kernel.GH_Document class. There's both shared properties and instance properties:

 

GH_Document.DefaultPreviewColour = ...

GH_Document.DefaultPreviewColourSelected = ...

 

change the colours that are assigned to new documents, but they won't affect existing documents.

 

Dim doc As GH_Document = ...

doc.PreviewColour = ...

doc.PreviewColourSelected = ...

 

These two properties change the colours of an existing document.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David, actually I am looking for a way to custom defined object display color. Like Custom preview component.

Thanks,

raf

Well, in that case you have to hijack the drawing routines for your object. This is only possible if it is indeed your object.

 

If you derive from GH_Component (like Custom Preview does), then override the functions DrawViewportWires() and DrawViewportMeshes().

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

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