Jump to content

Change AutoCAD settings


mostafa_mashhadi

Recommended Posts

How can I replace this number in the photo with a lisp? Can someone write lispy for me?

Screenshot 2024-08-31 125413.jpg

Link to comment
Share on other sites

You need just to type "TEXTSIZE" in command prompt and put the number wish you want.

Edited by Saxlle
Link to comment
Share on other sites

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

Screenshot 2024-09-01 121731.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

"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 by BIGAL
  • Like 1
Link to comment
Share on other sites

For Dimension Text, Type DIMTXT, then enter the size you want. Again - no Lisp solution needed.

Edited by pkenewell
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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 by pkenewell
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...