Lisp to create a dim with fix text dim "@50"

Lisp to create a dim with fix text dim "@50"

tinh_hcmut
Explorer Explorer
354 Views
5 Replies
Message 1 of 6

Lisp to create a dim with fix text dim "@50"

tinh_hcmut
Explorer
Explorer

Hi all,

Please help me to make a Lisp to create a dim with always show dim value is "@50". The command maybe called : d50

Currently i use 2 command : dimlinear to create a dim and then ddedit to edit dim text value to @Anonymous. How can i combine into 1 command d50

Thank you so much

0 Likes
Accepted solutions (1)
355 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant

(defun c:D50 () (command-s "_.DIMLINEAR") (setpropertyvalue (entlast) "DimensionText" "@50") (princ))

Message 3 of 6

tinh_hcmut
Explorer
Explorer
Thank for your feedback but it said
Error: undefined function - COMMAND-S
I use cad2007 fyi
0 Likes
Message 4 of 6

ВeekeeCZ
Consultant
Consultant
Accepted solution

Well, none of the previously used funcs is available in 2007.

 

(defun c:D50 ()
  (command "_.DIMLINEAR") (while (> (getvar 'cmdactive) 0) (command pause))
  (entmod (subst '(1 . "@50") (assoc 1 (entget (entlast))) (entget (entlast))))
  (princ)
  )

 

Message 5 of 6

tinh_hcmut
Explorer
Explorer
it worked. Thank you very much.
0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Another.

 

 

(defun c:d50 ( / )
(command-s "_.DIMLINEAR" (getpoint "\nPick 1st point ")(getpoint "\nPick second point ") "T" (strcat "<>@50") )
(princ)
)

 

0 Likes