; ----------------- DimScale.gxm (Set size parameters for text & dimensions) ------------------- ; This is a macro for General CADD Pro. ; ; The macro sets size parameters for text and dimension entities. After running the macro, ; all text, dimensions and leaders will be sized as a ratio of your chosen text size. ; Note: only dimensions and text placed after running the macro will be affected. It is ; suggested that you run this macro before placing dimensions. To change scale of existing ; dimensions and text use the macro: "DimRescale.gxm". ; ; A dimscale of 1 sets text sizes (TZ & DT,Z) to 1 unit in the active unit system. Other ; dimension entities are scaled as a ratio of TZ. ; ; The following parameters are changed: ; Text Size: TZ = User defined value ; 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(2),$R(2); ; ; -------------- VARIABLE USAGE -------------- ; /VRL,0 $R(0): Default/User defined text size ; /VRL,1 $R(1): Entity scale value ; /VRL,2 $R(2): ABS entity scale value ; ; Gary Calhoun, December 3, 2013 ; ;----------------------------------------------------------------------------------------------- ;*** Initialize variables, get current text size *** ; /MSP,++; * message suppression on /XMD,++; * expert mode on /VLC; * clear user variables ; TZ,!,/VRL,0,$VAL; * get text size, assign to $R(0) ; ;----------------------------------------------------------------------------------------------- ; *** Intro to user, input from user, test input, feedback to user *** ; /PMT,1,'[DimScale :] Set Scale of Dimension Entities Relative to Text Size',#; ; * prompt to display macro name ; .ENTER_TZ; * label for zero-test loop (if TZ = 0) ; /PMT,2,'Change Text Size (',$R(0),') >_',#; ; * prompt for user input (displays current/default text size) ; /VRL,0,~; * reassign user input to $R(0) ; keeps current/default text size ; /IF,$DERR[EQ]-2,/GTO,ESC; * if key is hit go to label ESC /IF,$R(0)[EQ]0,/GTO,ENTER_TZ; * test user input for zero value (loop if = 0) ; /VRL,1,$R(0); * assign value to $R(1) (entity scale value) ; /VRL,2,$ABS($R(1)); * set $R(2) to ABSOLUTE value of TZ ; (positive value to scale dimension entities) ; /PMT,3,'Text Size : [',$R(1),']',#; ; * prompt to display new text size WB,2; * pause 2 seconds for user to read new text size ;----------------------------------------------------------------------------------------------- ; *** Set size of specific parameters, exit *** ; TZ,$R(1); * text size: (TZ) = $R(1) ; set value of TZ, can be either positive or negative ; DQ,TZ,$R(2),TI,$R(2),TA,$R(2)/4,AL,$R(2),EO,$R(2)/2,EA,$R(2)/2,EB,$R(2)*2.5,ES,$R(2),!; ; * dimension query, set size of desired dimension entities ; GS,$R(2),$R(2); * grid size: X = (TZ), Y = (TZ) ; .ESC; * label for to quit /XMD,--; * expert mode off /MSP,--,PU; * message suppression off, clear prompt area