#!MC 1400 $!MacroFunction NAME = "Constrain Slice" ShowInMacroPanel = TRUE #$!GLOBALCONTOUR 1 VAR = 7 # the number of your contour variable, e.g. V7 in this example # set contour, turn slice on $!CONTOURLEVELS RESETTONICE CONTOURGROUP = 1 APPROXNUMVALUES = 15 $!SLICELAYERS SHOW = YES $!SLICEATTRIBUTES 1 SLICECONSTRAINT{INCLUDE = YES} # box dimension values $!SLICEATTRIBUTES 1 SLICECONSTRAINT{BOXDIMENSION{X = 1.1}} $!SLICEATTRIBUTES 1 SLICECONSTRAINT{BOXDIMENSION{Y = 1.1}} $!SLICEATTRIBUTES 1 SLICECONSTRAINT{BOXDIMENSION{Z = 1.1}} # box center values $!SLICEATTRIBUTES 1 SLICECONSTRAINT{ORIGIN{X = 0.0}} $!SLICEATTRIBUTES 1 SLICECONSTRAINT{ORIGIN{Y = 0.0}} $!SLICEATTRIBUTES 1 SLICECONSTRAINT{ORIGIN{Z = 0.0}} $!REDRAWALL $! Pause "Slice Size Constrained to 0/0/0, 1/1/1" $!ENDMACROFUNCTION # # Use this to turn off the constraints on the slice: # $!SLICEATTRIBUTES 1 SLICECONSTRAINT{INCLUDE = NO} # # Improvement ideas: # Create a UI to prompt for the constraint-box- center and extents # Use the UI to toggle slice-constraints on/off, select variable, etc. # Add the macro to your QuickMacro panel