And if no Leader is found...the routine is ended. How to pause the routine and continue until the user selected a leader to modify?
You could use a
while loop to continuously prompt the user until a valid selection is made:
(defun c:try ( / cm ss )
(while (null (setq ss (ssget "_:L" '((0 . "LEADER")))))
(princ "\nNo Leaders Selected.")
)
(setq cm (getvar 'cmdecho))
(setvar 'cmdecho 0)
(command "_.dimoverride" "dimclrd" 256 "dimclre" 256 "" ss "")
(setvar 'cmdecho cm)
(princ)
)
Though note that by using this construct the user must press
Esc should he/she wish to exit the program without modifying any Leaders.
I would also recommend that you ensure that your code is indented in a logical manner, as this will improve the readability of your code and also help you to spot mistakes. What editor are you using to write your code?