Hi all, I am in need of an urgent help. I am trying to create a pass-through script component with dynamic inputs and outputs from an external python script by using RhinoCodePluginGH.Parameters. I am successful in creating the parameters but I am not able to have the inputs pass-through to the outputs even though they have the same name.
However, When I try saving and reopening the script or just cut and paste the component back, it seems to pass through. I tried expiring solution in the script but it doesnt work without the component being ‘reloaded’
Is there a way to get this working? Here is my code and an image.
create_schema.py (2.2 KB)
If the parameter schema is known from the source code, it may be simpler to avoid modifying ghenv.Component.Params during a solve.
With Ghost Writer, Python inputs and outputs are declared in the typed run() signature. Changing that signature and saving updates the component ports, while the docstring supplies their descriptions; the component is then recompiled/reloaded through its normal lifecycle instead of mutating its parameters during execution.
This would not replace a component whose port count must change dynamically on every solve, but it should fit a code-defined external-script schema and avoid the reload problem described here. Disclosure: I’m the developer.