algorithmic modeling for Rhino
Hi, I am trying to modify a gene pool component through script (c sharp component), in particular the number of genes it contains should be related to the number of objects contained in a list. Searching around I found a way to get almost to the solution, but I still need to manually recompute the solution for the changes to be applied. (useful discussion --> http://www.grasshopper3d.com/forum/topics/request-parametric-genome...)
It would be great to have an example showing how to do it (I suppose that the solution end event might be involved, but an event fired everytime the input of the component are modified might be even smarter). Attached you can find my partial result (the commented lines show an attempt I was trying, leading to a continuous (and quite annoying) loop of expire solutions)
Thank you in advance for your help
Tags:
Hi Pietro,
I do not know from where have gone out the methods used by David in the script of the thread above, but you can access to any component (I think) in the document and change their values. What happens is that Genelist is in a different assembly, but you can reference it to your script to access to the genelist object (GalapagosComponents.GalapagosGeneListObject) and change their values. Check the file. Curiously, this component is updated whenever their values change, without need to recompute, so good!
Hi Daniel, thank you for your reply. The possibility to access directly to the component properties is quite useful, but still doesn't do the trick. If you see the attached image, the path between the input change and the "listener" is a little longer and, I don't know why, I need to manually refresh to make it work.
Could you reproduce it in another definition so we can see it?
Off the lines of code that you will not use? as Remap or random methods.
Try moving the arrange of the first component or script from Edit> Arrange> Put to back / Bring to Front.
But I really do not know what is going wrong.
Hi Daniel,
Is there any way to access to GalapagosComponents.GalapagosGeneListObject in a python script?
I need to retrieve information such as TickCount and TickValue in slider objects.
Best,
Milad
Thanks Daniel! If anyone wants to update this to Rhino6, you will have to copy and paste the code from the C# component to a new one (we still can't deference an assembly -_-) and reference to the assembly: "C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Components\GalapagosComponents.gha"
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by