Toggle shortcut key for biped hide unhide issue


#1

Hi guys,
I am new to max. I need a shortcut key which will toggle show hide biped bone objects.
While searching on net I came across with many scripts… for examples this one.

macroScript sc_toggleBoneDisplay
category:“scrimskiUI”
Buttontext:“Toggle Bone Display”
tooltip:“Toggle Bone Display”

(
on execute do
(
case of
(
(for b in objects where isKindOf b BoneGeometry or classOf b == Biped_Object do b.isHidden = state)

	)					   
)	

)
This is a great script. It worked. now I can toggle show/hide biped with a single shortcut key, but the problem is when I hide biped I loose my bone selection which is irritating me now. If I create a button with same script ……
macroScript Macro4
category:“DragAndDrop”
toolTip:""
(
try(destroydialog ::testRoll) catch()
rollout testRoll “BonesHide”
(
checkbutton btn_bone “Hide Bones” pos:[5,5] width:140 height:40
on btn_bone changed state do (for b in objects where isKindOf b BoneGeometry or classOf b == Biped_Object do b.isHidden = state)
)
createDialog testRoll 150 50 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
)
**It works great. and it does not loose my selection also. but I want same result in shortcut key which is missing. I tried many scripts from net, one from this website also. but unfortunately I am having same problem with all the scripts. **
Please help me in this. If you did not understand my exact problem please mention here, I will explain again.
thank you


#2

sorry for reposting. I accidently did it. sorry.