Grasshopper

algorithmic modeling for Rhino

Hi,

I am having a problem to register input for a custom component and hope someone could help me. The component works like this: an event could be raised by a windows form and the component class could catch it and register new input for the component.

I register new input as follow:

Param_GenericObject pointInput = new Param_GenericObject();
pointInput.Name = "Point";
pointInput.NickName = "P";
pointInput.Description = "Point Input";
pointInput.Access = GH_ParamAccess.list;
this.Params.RegisterInputParam(pointInput, 2);
this.Params.Input[2].ExpireSolution(true);
pointListInputIndex = 2;

The problem is when the inputs (P and V in the images) are registered, they showed up on the component but I could not access them, nothing could be connected to them. The right click menu on these two input is also for the component. It is just as if they are not there. I can see them but there is nothing I can do about them.

If I just drop or delete any component in the canvas(not connecting to the custom component), then the new registered inputs works fine and the menu for the input works as well. I tried recompute and disable/enable the component, neither can make this change.

Does anyone know how to fix this? Is there a special event when we drop a new component which could affect another component? Thank you.

Xiaoming 

Views: 320

Attachments:

Replies to This Discussion

Try calling OnParametersChanged() on the Params object of your component.

Thank you! Works perfectly!

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