algorithmic modeling for Rhino
Hi Pieter -
Try the attached. It will set the nickname of all sliders in the document to be an empty string, which causes them to automatically take on the names of the inputs they're plugged into. I've also left a few lines commented, which you can add if you want the script to only affect sliders that are currently called "Slider" (and ignore any sliders you've manually given names to).
Hope that helps!
var sliders = GrasshopperDocument.ActiveObjects().Where(o => o is Grasshopper.Kernel.Special.GH_NumberSlider).Cast<Grasshopper.Kernel.Special.GH_NumberSlider>();
foreach(Grasshopper.Kernel.Special.GH_NumberSlider slider in sliders){
// if(slider.NickName == "Slider"){
slider.NickName = "";
// }
}
Spot on Andrew, thank you so much! That does help indeed:)
Somehow I thought the older sliders were just incapable of this tagging functionality - hence the 'replace' question - but I'm glad you've proven me wrong (and I regret not getting around to try this myself). I guess my assumption was wrong because the older definitions simply use the current available Slider, right?
I uncommented the conditional statement, thanks for thinking along Andrew:) Cool:)
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by