; ---------------------- DimRescale.gxm (Change size of text & dimensions) ------------------------ ; This is a macro for General CADD Pro. ; ; As paper size or plot scale changes, it may be necessary to rescale dimensions and text to print ; at a reasonable size. This macro scales dimensions, leaders and text relative to plot scale. ; Note: all existing dimensions and any text chosen while running the macro will be updated ; to the new size. Additionally, any new text or dimensions placed after running the macro will ; also be the new size. ; ; The default plotted text size is set to .125" or equivalent in the active unit system. This ; value can be changed at the beginning of the macro. A plot scale of 1 equals actual and plotted text ; sizes (TZ & DT,Z) of .125" (3.175 mm). All other dimension entities are scaled to a ratio of TZ. ; If you want a different default plotted text size, edit this macro by changing the value of ; /VRL,1 from 0.125 to another value in inches. ; To do this, find the line of code below that reads: /VRL,1,(0.125*$R(0)); ; ; Consider the following example: ; The plotted text size is to be .100" and the plot scale is to be 100. These two values are entered ; during the macro. The text size will be set to 10" (100 * .100") Other dimension entities will be ; scaled to a ratio of 10". ; ; The following parameters are changed: ; Text Size: TZ = (PlotScale*PlottedTextSize) ; Dimension Text: size = TZ, in-line offset = TZ, above offset = (TZ/4) ; Arrow Length: = TZ ; Extension Settings: offset = (TZ/2), above length = (TZ/2), below length = (TZ*2.5) ; Leader Shoulder Length: = TZ ; Grid Size: X = TZ, Y = TZ ; ; Grid size is set to aid in spacing dimensions. My dimension lines are usually spaced 2 to 4 * TZ. ; If you do not want to resize your grid, edit this macro by adding a semicolon preceding GS in the ; line of code below that reads: GS,$R(4),$R(4); ; ; It is suggested that you first know what your plot scale will be before running the macro. ; Initially, the macro calculates a default plot scale that is based on the current dimension text ; size. If the current dimension text size is set "out of scale" with the drawing, the default scale ; will likely be incorrect. This does not matter - simply enter the correct values when prompted. ; ; -------------------- VARIABLE USAGE -------------------- ; /VRL,0 $R(0): Display unit conversion factor ; /VRL,1 $R(1): Default & user defined plotted text size ; /VRL,2 $R(2): Input dimension text size ; /VRL,3 $R(3): Default & user defined plot scale ; /VRL,4 $R(4): Output text size and dimension text size ; ; Gary Calhoun, December 3, 2013 ; ;--------------------------------------------------------------------------------------------------- ; *** Initialize variables, get display unit conversion factor, set default plotted text size, ; user intro, get user plotted text size, test input, get default dimension text size, ; calculate default plot scale *** ; /MSP,++; * message suppression on /XMD,++; * expert mode on /VLC; * clear user variables ; /SYS,C,C,/VRL,0,$VAL; * get display unit conversion factor & ; assign to $R(0) ; /VRL,1,(0.125*$R(0)); * default plotted text size (is set to: 0.125") ; assign to $R(1) ; /PMT,1,'[DimRescale :] Rescale Dimension Entities Relative to Plot Scale',#; ; * prompt to display macro name .ENTER_PTZ; ; /PMT,2,'Enter Plotted Text Size (',$R(1),') >_',#; ; * prompt to change plotted text size ; /VRL,1,~; * assign user input to $R(1) ; overwrite default plotted text size ; or to keep default value ; /IF,$DERR[EQ]-2,/GTO,ESC; * if key is hit go to label ESC ; /IF,$R(1)[EQ]0,/GTO,ENTER_PTZ; * test user input for zero value (loop if entry = 0) ; DT,Z,!,!,/VRL,2,$VAL; * get dimension text size of current drawing, assign to $R(2) ; current DT,Z is used to set the default plot scale ; /VRL,3,$R(2)/$R(1); * calculate default plot scale, assign to $R(3) ; ;--------------------------------------------------------------------------------------------------- ; *** Get user plot scale, test input, set scale factor, feedback info to user *** ; .ENTER_PZ; * label for test loop (if TZ = 0) ; /PMT,2,'Enter Plot Scale (',$R(3),') >_',#; ; * prompt for user input (displays current plot scale) ; /VRL,3,~; * assign user plot scale to $R(3) ; /IF,$DERR[EQ]-2,/GTO,ESC; * if key is hit go to label ESC ; /IF,$R(3)[EQ]0,/GTO,ENTER_PZ; * test user input for zero value (loop if entry = 0) ; keeps current default scale ; /VRL,4,$R(3)*$R(1); * assign value to $R(4) (value for text size & dim. text size) ; /PMT,2,'Plot Scale : [',$R(3),']',#; * prompt displays plot Scale ; /PMT,3,' Text Size : [',$R(4),']',#; * prompt displays output text Size ; WB,2; * pause 2 seconds for user to read new plot scale ; and text size ; ;--------------------------------------------------------------------------------------------------- ; *** Set size parameters, Select and scale existing entities, exit *** ; TZ,$R(4); * text size: TZ = $R(4) ... set value of TZ ; ; DQ,TZ,$R(4),TI,$R(4),TA,$R(4)/4,AL,$R(4),EO,$R(4)/2,EA,$R(4)/2,EB,$R(4)*2.5,ES,$R(4),!; ; * dimension query, set size of specific dimension entities ; GS,$R(4),$R(4); * update grid size: X = TZ, Y = TZ ; UG,D,!,TZ,$R(4),TI,$R(4),TA,$R(4)/4,AL,$R(4),EO,$R(4)/2,EA,$R(4)/2,EB,$R(4)*2.5,ES,$R(4),!; ; * dimension change: update existing dimension entity sizes ; .SEL_TXT; * label for jump to text selection process /SEL,Select TEXT to be SCALED [... ESC to EXIT]; ; * selection prompt for selecting text ; /IF,$DERR[EQ]-2,/GTO,ESC; * exit program if key is hit ; TG,L,!,TZ,$R(4),!; * change all text selected during selection prompt ; /GTO,SEL_TXT; * loop back to text selection process until ; key ends process ; .ESC; * label for to quit /XMD,--; * expert mode off /MSP,--,PU; * message suppression off, clear prompt area