designerstuart 发表于 2022-7-5 23:50:39

one-click override dimension w

hi all
 
i want to be able to change a dimension to read "eq" or "equal" etc just by one click. i expect this is possible but i don't know how to do it.
 
at the moment i spend a lot of time typing "eq" when making lighting layouts and general setting out drawings. i would like to automate it, and have no preference between button or command.
 
if possible, change multiple dims together would also be handy.
 
thanks for any help

Lee Mac 发表于 2022-7-6 00:00:22

Try the following:
(defun c:dimeq ( / e i s )   (if (setq s (ssget "_:L" '((0 . "*DIMENSION"))))       (repeat (setq i (sslength s))         (setq e (entget (ssname s (setq i (1- i)))))         (entmod (subst '(1 . "eq") (assoc 1 e) e))       )   )   (princ))

designerstuart 发表于 2022-7-6 00:10:19

Lee Mac - the original and still the finest!
thank you, it is perfect for my needs. one of these days i will donate to your website. legend!

Lee Mac 发表于 2022-7-6 00:18:31

That's very kind of you Stuart, thank you

designerstuart 发表于 2022-7-6 00:22:18

right, so this works like a charm, very pleased thanks lee!
 
now i want to do the opposite!
is it possible to remove dimension override text with a one-click function?
 
either select lots of dims, input command, and all dims are back to 'natural' state
or failing that, input command, pick a dim, it reverts to 'natural'
 
thanks all, most appreciated!

MSasu 发表于 2022-7-6 00:34:59

Please adjust this line:

(entmod (subst '(1 . "") (assoc 1 e) e))   ;replace "eq" with ""

cwake 发表于 2022-7-6 00:37:17

There are several options Stuart. You could use the routine that Lee gave you and change the text that it uses to either an empty string i.e. "" or the less than-greater than "".
 
as in

(entmod (subst '(1 . "") (assoc 1 e) e))or(entmod (subst '(1 . "") (assoc 1 e) e))
 
Or alternatively the standard autocad command "dimedit" => "new" => "OK"

pBe 发表于 2022-7-6 00:47:34

or even
 
command: Dim
n
(select all)
 
EDIT: oops(look up ↑)

designerstuart 发表于 2022-7-6 00:51:29

great chaps, thank you. i prefer theoption, that makes sense to me.
页: [1]
查看完整版本: one-click override dimension w