Using BeforeSolveInstance() of a custom component, I am redefining the attributes of an input value lists. If a new value list is added to the input parameters, I am trying to avoid having to redefine already modified value lists. I am achieving this by keeping track of the InstanceGuid of input components through a HashSet. However, this logic, of course, breaks in the rare case of a value list being disconnected, modified (manually or through some other component) and then reconnected. Is there a way to identify GUIDs of components that are removed from input params or do I need to look for a better logic in implementing this?
@DavidRutten@gankeyu Thank you both. Apologies for the late response here, haven’t had time to revisit this, until now. I was hoping to use this for two things, to create value lists for enum types and also installed fonts. I’ve attached a file that takes your suggestion into populating a value list with installed fonts. I’ve realized though that the approach to solving this problem is not so clean in general and Ideally, I’d have a custom value list component with my types ready to drop unto the GH canvas. I know you can do that by creating a user object from a modified value list component, but then that won’t be part of the gha assembly.
Based on this discussion the way to do that seems to inheret GH_Param<GH_Integer>, (and IGH_StateAwareObject? to make sure it doesn’t return to the default state when loading a gh file), am I on the right path here?