macroScript Instance_By_WireColor category:"_My Scripts_" tooltip:"Select Instance By WireColor" ( local CheckHF_State = false fn OpenGroup_Recursively array = ( temp_array = for i in array where isValidNode i and isGroupHead i collect i with redraw off (for i in temp_array do (setGroupOpen i true)) select temp_array ; redrawViews() ) fn Check_HiddenFrozen array = ( for i in array do ( try(if getproperty i #isHidden == true do setproperty i #ishidden false)catch() try(if getproperty i #isFrozen == true do setproperty i #isFrozen false)catch() ) array ) fn Select_Objs array = ( if array != undefined and array.count != 0 do ( array = for i in array where (try(i.name != undefined)catch(false)) collect i if CheckHF_State then array = Check_HiddenFrozen array else ( array = for i in array where (try(getproperty i #isHidden == false)catch()) and \ (try(getproperty i #isFrozen == false)catch()) collect i ) clearSelection(); try(select array)catch() temp_array = for i in selection collect i OpenGroup_Recursively temp_array; try(select array)catch() ) ) on isEnabled return selection.count != 0 on execute do ( local Array2Select = #() , objs = selection as array for i in objs do ( wl = try(i.wirecolor)catch(undefined) if wl != undefined then ( for obj in Geometry where obj.wirecolor == wl do append Array2Select obj for shp in Shapes where try(shp.render_renderable)catch(false) and shp.wirecolor == wl do append Array2Select shp ) ) if Array2Select.count != 0 then Select_Objs Array2Select ) )