mostafa_mashhadi Posted August 31, 2024 Posted August 31, 2024 How can I replace this number in the photo with a lisp? Can someone write lispy for me? Quote
Saxlle Posted September 1, 2024 Posted September 1, 2024 (edited) You need just to type "TEXTSIZE" in command prompt and put the number wish you want. Edited September 1, 2024 by Saxlle Quote
mostafa_mashhadi Posted September 1, 2024 Author Posted September 1, 2024 1 hour ago, Saxlle said: You need just to type "TEXTSIZE" in command prompt and put the number wish you want. thank you I apologize. I asked the wrong question. I want to change the following number by a lisp. please help Quote
Steven P Posted September 1, 2024 Posted September 1, 2024 Is this a change for all text created in the drawing or for a single piece of text? Quote
mostafa_mashhadi Posted September 1, 2024 Author Posted September 1, 2024 40 minutes ago, Steven P said: Is this a change for all text created in the drawing or for a single piece of text? all text Quote
Saxlle Posted September 1, 2024 Posted September 1, 2024 Can you post a .dwg where you want to modify text height in model space? Quote
Steven P Posted September 1, 2024 Posted September 1, 2024 might be (setvar 'textsize -newtextheightasnumber-) Quote
BIGAL Posted September 1, 2024 Posted September 1, 2024 (edited) "all text" but image is change dimension text height. TEXT & Dimension Text are 2 different objects. Changing 'textsize does not change dims if style is set with a non zero height. Same with Text. Post a dwg. Edited September 1, 2024 by BIGAL 1 Quote
pkenewell Posted September 3, 2024 Posted September 3, 2024 (edited) For Dimension Text, Type DIMTXT, then enter the size you want. Again - no Lisp solution needed. Edited September 3, 2024 by pkenewell Quote
SLW210 Posted September 4, 2024 Posted September 4, 2024 After DIMTXT is set, you need to use -DIMSTYLE>APPLY, then for select type ALL then ENTER, to update the dimension(s). A LISP or Script would be handy if needing to do a lot of drawings. P.S. DIMTXT is a System Variable (Sysvar) = (SETVAR "DIMTXT" 2) Quote
SLW210 Posted September 4, 2024 Posted September 4, 2024 Something like this... (defun c:UpDimTxt (/ dimtxt newDimtxt dimStyleName) ;; Prompt user for new dimension text height (setq newDimtxt (getreal "\nEnter new dimension text height: ")) ;; Check if user input is valid (if (not newDimtxt) (progn (princ "\nInvalid input. Exiting...") (exit) ) ) ;; Set the DIMTXT system variable to the new value (setvar 'DIMTXT newDimtxt) ;; Update the dimension style (command "-DIMSTYLE" "Apply" "All" "") ) (princ "\nType 'UpDimTxt' to run the routine.") (princ) Quote
pkenewell Posted September 4, 2024 Posted September 4, 2024 (edited) If you DON'T want it to apply the change to all the dimensions with that style, use the DIMOVERRIDE command to change selected dimensions. Here is a tool that I use to create quick Dimension override commands: ;;----- (pjk-dmovr [Dim. Variable][Value]) --------------------------------- ;; Performs the DIMOVERRIDE command with the given Dimvar and Value (defun pjk-dmovr (var stat / dset oe) (setq oe (getvar "cmdecho")) (setvar "cmdecho" 0) (setq stat (cond ((= (type stat) 'STR) stat) ((= (type stat) 'REAL) (rtos stat 2 8)) ((= (type stat) 'INT) (itoa stat)) (t nil) ) ) (if (and var (getvar var) stat) (progn (princ (strcat "\nVariable " (strcase var) " Selected - New Value: " (strcase stat))) (princ "\nSelect Associative Dimension(s) to Change: ") (if (setq dset (ssget '((0 . "DIMENSION")))) (command "._dimoverride" var stat "" dset "") ) ) ) (setvar "cmdecho" oe) (princ) ) ; End Function "pjk-dmovr" ;; EXAMPLE commands: (defun C:DC1 ()(pjk-dmovr "dimcen" 0)) ; Turn off Center (defun C:DC2 ()(pjk-dmovr "dimcen" -0.06)) ; Turn on Center (defun C:DBS ()(pjk-dmovr "dimgap" (- (getvar "dimgap")))) ; Change to Basic Dimension (defun C:DTZ ()(pjk-dmovr "dimtxt" 0.188)); Set Dim Text Height to 3/16" ;;----- DMTH - Change Overall Dimension Text Height. --------- (defun C:DMTH (/ g1) (initget 6) (if (setq g1 (getreal "\nNew Text Height: ")) (pjk-dmovr "dimtxt" g1) ) ) ; End Command Function "C:DMTH" Edited September 4, 2024 by pkenewell Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.