Grasshopper

algorithmic modeling for Rhino

Hi,

I have registered an input parameter in the custom component as following:

pManager.AddBrepParameter("List of Brep", "srfs", "Surfaces to select from", GH_ParamAccess.list)

However when the one of the input is Null, GH gives an error: "Value cannot be NULL".

How can I allow to accept Null values in the input however to filter them out to proceed only with valid List members?

Thanks in advance,

Dmitriy

Views: 357

Replies to This Discussion

Hi,

You can set a conditional after the declaration where you check whether you brep is valid. Then you either return or continue with the solution.

C#
public virtualboolIsValid { get; }
Visual Basic
Public Overridable ReadOnly Property IsValid AsBooleanGet

Best,

M

edit: haven't test this, but I think it will work..

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service