Grasshopper

algorithmic modeling for Rhino

How to throw a warning or error to turn the component orange or red?

I have a few conditions I want to have warnings or errors for in my code.  I see the GH_RuntimeMessageLevel enum, but how is it that one can utilize it to display the appropriate warning or error color for the component?  I will probably bump into it sooner or later, but I wanted to ask here as a bit of searching didn't turn up anything obvious.

Views: 3209

Replies to This Discussion

AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Warning message here");

Warning turns component orange, Error turns it red.

Exactly what I needed.  Thanks a lot!

This is inspired for me, but is it possible to stop the solver at the mean time?

GrasshopperDocument.RequestAbortSolution();

Then exit the script.

I looked for this method again today, but I can not find it under GH_Document. I'm using 0.9.0076

Should be there. It's not a static method, you need to look for it on an actual instance of GH_Document

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