Hi guys,
I found this Python code to change wires of selected componets so kindly provided by Atelier Panda on this page.
http://pandagopanda.com/thoughts/2014/7/28/meta-grasshoppering-i-cleaning-up-wires
from Grasshopper.Kernel import GH_ParamWireDisplay
from Grasshopper.Kernel import GH_RuntimeMessageLevel
# A dictionary of wire types
wire_display = {'0':GH_ParamWireDisplay.default,
'1':GH_ParamWireDisplay.faint,
'2':GH_ParamWireDisplay.hidden}
# Get selected components and change the wire display
if on:
doc = ghenv.Component.OnPingDocument()
sel_objs = doc.SelectedObjects()
if not len(sel_objs):
ghenv.Component.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, 'Nothing was selected')
for sel_obj in sel_objs:
if not hasattr(sel_obj, 'Params'): continue
for p in sel_obj.Params.Input:
p.WireDisplay = wire_display[wire_type]
I might be just needing one more step of specification, I would like to change specifically all M inputs on the Custom Preview component.
I have been taking a look at the Grasshopper SDK but I could’t find any reference to selecting specific inputs of components…
Thanks for any insight,
Shynn

