Hi
I want to change dim text offset of the drawing zone with lisp. how can I do it?
Hi
I want to change dim text offset of the drawing zone with lisp. how can I do it?
try this :
Code:(defun c:test (/ ) (setq cmd1 (getvar "cmdecho")) (setvar "cmdecho" 0) (setq DIMNEW (entsel "\n Select Dimension to Adjust Dimension Text Offset:")) (command "dimoverride" "dimgap" "3" "" DIMNEW) <<<<----- change the "3" to your desired text offset (setvar "cmdecho" cmd1) (princ) )
"Memories fade but the scars still linger..."
that is what I am looking for. thanks a lot.
I've modified nod684's code a bit : credit goes to nod still for the help...
This will enable you to input your desired Txt Offset and will also enable you to select multiple dimensions that you want to change :
Code:(defun c:test (/ ) (setq cmd1 (getvar "cmdecho")) (setvar "cmdecho" 0) (setq TOffset (getreal "\nEnter Desired Text Offset : ")) (prompt "\nSelect Dimension to Adjust Dimension Text Offset:") (while (if (setq en (ssget '((0 . "DIMENSION")))) (command "dimoverride" "dimgap" TOffset "" en "") (Princ "\nNo Dimensions selected! Try again!") ) ) (setvar "cmdecho" cmd1) (princ "\nDone!") (princ))
Last edited by meandyoulagi367990; 2012-09-22 at 06:09 AM.
thanks meandyou...i was thinking bout this
but my one was done in a jiffy
in fact haven't had time to check if working or not lolz!
try this one; with Dimension Height as default Dimgap :
Code:(defun c:test (/ ) (setq cmd1 (getvar "cmdecho")) (setvar "cmdecho" 0) (setq dimtxt (getvar "Dimtxt")) (setq TOffset (getreal "\nEnter Desired Text Offset : <" (rtos Dimtxt) "> ")) (if (= TOffset nil) (setq TOffset dimtxt)) (prompt "\nSelect Dimension to Adjust Dimension Text Offset:") (while (if (setq en (ssget '((0 . "DIMENSION")))) (command "dimoverride" "dimgap" TOffset "" en "") (Princ "\nNo Dimensions selected! Try again!") ) ) (setvar "cmdecho" cmd1) (princ "\nDone!") (princ))
Last edited by nod684; 2012-09-24 at 05:35 AM.
"Memories fade but the scars still linger..."
@nod684
Localizing variables is very important in all routines , except when it is needed globally for any specific case.![]()