3rd Dimentia
03-25-2008, 06:57 AM
Hi, I've only just started playing with callbacks. I have a basic understanding of them where I can get this to work
callbacks.removescripts id:#printTest
fn PrintSomething =
(
print " HEY it's working"
)
callbacks.addscript #byCategoryDisplayFilterChanged "PrintSomething()" id:#printTest
I have a macroscript that I use to show and change the hide by category without having to go to the display command panel which is this:
macroScript HideByCategoryGeom
buttonText:"G"
category:"CgRay"
toolTip:"Hide By Category Geometry"
(
on isChecked do
( hideByCategory.geometry
)
on execute do (
hideByCategory.geometry = not hideByCategory.geometry
)
)
The issue I have, is that when I use this it works fine and the toolbar button changes if you change the hide by category with the keyboard shortcut. And it works fine by using the macroscript button. But when you change the hide by category option in the display command panel, the toolbar macroscript button doesn't change. I'm figuring I need to use a callback but am unsure of how to go about incorporating a callback into that macro. Can anyone help?
Cheers,
Cg.
callbacks.removescripts id:#printTest
fn PrintSomething =
(
print " HEY it's working"
)
callbacks.addscript #byCategoryDisplayFilterChanged "PrintSomething()" id:#printTest
I have a macroscript that I use to show and change the hide by category without having to go to the display command panel which is this:
macroScript HideByCategoryGeom
buttonText:"G"
category:"CgRay"
toolTip:"Hide By Category Geometry"
(
on isChecked do
( hideByCategory.geometry
)
on execute do (
hideByCategory.geometry = not hideByCategory.geometry
)
)
The issue I have, is that when I use this it works fine and the toolbar button changes if you change the hide by category with the keyboard shortcut. And it works fine by using the macroscript button. But when you change the hide by category option in the display command panel, the toolbar macroscript button doesn't change. I'm figuring I need to use a callback but am unsure of how to go about incorporating a callback into that macro. Can anyone help?
Cheers,
Cg.
