Grasshopper

algorithmic modeling for Rhino

Hi, all

Is it possible, assign default value to GenericParameter?

I couldn't find the way, in RegisterInputParams().

but maybe is it possible in SolveInstance() or VariableParameterMaintenance()?

Views: 415

Replies to This Discussion

It is possible, but you must cast the IGH_Param to Grasshopper.Kernel.Parameters.Param_GenericObject and then you can access the PersistentData. The problem is that not all data types serialize equally well, especially on Rhino4.

You could also make the parameter optional and then in SolveInstance just replace the null with whatever default you want.

--

David Rutten

david@mcneel.com

Thank you. It works with setting parameter optional :D

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