Grasshopper

algorithmic modeling for Rhino

Default input for pManager.AddGenericParameter() Input Param if using custom data type?

Hello,

Can a default value be added for an input using a pManager.AddGenericParameter() Input Param when using a custom data type (derived from IGH_Goo) on visual studio?

Many thanks,

Arthur

Views: 669

Replies to This Discussion

Should be possible because Param_GenericObject implements IGH_PersistentParam. As long as the data you're adding properly (de)serializes it should be fine.

The parameter has SetPersistentData methods allowing you to assign that stuff and you get direct access to the PersistentData property as well.

An alternative approach (which might not make sense in your specific case) is to make the parameter Optional, and then insert your default value inside SolveInstance.

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