Grasshopper

algorithmic modeling for Rhino

Typical error handling on the class where SolveInstance() is located is typically just a "AddRuntimeMessage(..)" at the catch() statement.

My question is -- how do I implement the AddRuntimeMessage() in an external class? Understandingly, I get this error whenever I try to implement AddRuntimeMessage() on any external classes.

For example, I am able to use AddRuntimeMessage() in a Custom Attributes class (GH_ComponentAttributes) by doing Owner.AddRuntimeMessage(). I am able to use the Owner property in this custom attributes.

I am interested in using the AddRuntimeMessage property without creating a custom attribute class, since this new class is simply there for organization sake.

Views: 479

Replies to This Discussion

You need to have a reference to the object that exposes the AddRuntimeMessage() methods. You're going to have to either share your component class with this organisational class or find some other way to funnel your messages, for example by logging messages locally or populating a list of messages as an out parameter in a function calls.

--

David Rutten

david@mcneel.com

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service