[IConfig,4.8] [VarDef,numberOfLayers,0] //****routine to find the number of layers***************** [RoutineDef,GetLayers, [VarSet,numberOfLayers,0] [If,[IsEnabled,Tool:Layers:Layers Scrollbar],//if there's a scrollbar there is more than one layer //store current scroll bar position [VarSet,tmpLyScrPos,[IGetSecondary,Tool:Layers:Layers Scrollbar]] //set scroll bar to a maximum to ensure it is at the top [ISet,Tool:Layers:Layers Scrollbar,0,256] [VarSet,numberOfLayers,[IGetSecondary,Tool:Layers:Layers Scrollbar]+1] , [If,[IsEnabled,"Tool:Layers:Layer Intensity"], [VarSet,numberOfLayers,1] ] ] ]//end routine [RoutineDef,ToggleLayers,//turn all layers on/off for subtool [If,[IExists,Tool:Layers], [RoutineCall,GetLayers] [VarSet,bWidth,[IWidth,323]] [VarSet,tmpSubD,[IGet,Tool:Geometry:SDiv]] [If,numberOfLayers > 0, [ISet,Tool:Geometry:SDiv,[IGetMax,Tool:Geometry:SDiv]] ] [Loop,numberOfLayers, [ISet,Tool:Layers:Layers Scrollbar,0,[Val,n]] [If,on,//turn on [If,([IModGet,323]&2 != 2), [IClick,323,bWidth-10,6] ] ,//else turn off [If,(([IModGet,323]&2 == 2)||([IModGet,323]&1 == 1)), [If,([IModGet,323]&1 == 1),[IClick,323,bWidth-10,6]] [IClick,323,bWidth-10,6] ] ] ,n] [ISet,Tool:Geometry:SDiv,tmpSubD] ] ,on] [IButton,"Layers On","Turn all Layers on", [RoutineCall,ToggleLayers,1] ,,.5] [IButton,"Layers Off","Turn all Layers off", [RoutineCall,ToggleLayers,0] ,,.5]