When working with a large script with many clusters, is there any way to update all clusters at once, as opposed to having to comb through the script and update one-by-one?
If not, any ideas for strategies to approach this issue with?
Thanks
When working with a large script with many clusters, is there any way to update all clusters at once, as opposed to having to comb through the script and update one-by-one?
If not, any ideas for strategies to approach this issue with?
Thanks
are they all the same?
this throws an error message for each updated cluster, but it works:
if (update)
{
for (int i = 0; i < GrasshopperDocument.ObjectCount; i++)
{
if (GrasshopperDocument.Objects[i] is Grasshopper.Kernel.Special.GH_Cluster)
{
var cluster = GrasshopperDocument.Objects[i] as Grasshopper.Kernel.Special.GH_Cluster;
cluster.CreateFromFilePath(cluster.FilePath); // "Update" cluster
}
}
GrasshopperDocument.ExpireSolution();
}
updateClusters.gh (2.7 KB)
Probably if you delay this logic until after the solution is done you’ll get rid of those error messages.
I’ve upgraded @TomTom’s solution with some extra features we needed.
UpdateAllClusters.gh (5.7 KB)
Hey Max,
the Grasshopper file seems to miss the local Path Inputs. I cannot find the “…/” Component in Grasshopper. Without the localPath Inputs, the Script does not seem to work.
Where can I find this Component?
Best
Maximilian
Hi
It’s from metahopper plugin
thanks!
Just made an improved version allowing to internalize clusters when needed.
See here : One click solution for internalising all cluster - #11 by Laoky