no problem , this site is all about learning.
Just meant to say if all your old blocks have a blockname like ...A0M06... you may be able to compress your entire routine to :
(defun c:patjeacad ( / $p blk str s bn ip)
;;; ($p "DIN931-A0M06x45E" "*A#M##*") -> "A0M06"
(defun $p (s p)(if (and (wcmatch s p)(/= "" s))
(cond (($p (substr s 2) p))(($p (substr s 1 (1- (strlen s))) p))(s))))
(cond
((not (tblsearch "BLOCK" "BL$2----_KADER"))
(alert "Computer says no : No border in current drawing"))
((not (setq blk (entsel "\nSelect a bolt : ")))
(alert "Computer says no : nothing selected"))
((not (eq (cdr (assoc 0 (entget (car blk)))) "INSERT"))
(alert "Computer says no : selected item is not a block"))
((not (setq str (cdr (assoc 2 (entget (car blk))))))
(alert "Computer says no : bad block name"))
((setq s ($p str "*A#M##*")) (setq bn (strcat "DIN125A-" s "-E")))
(t (setq bn nil) (alert "Computer says no : invalid block"))
)
(if (and bn (setq ip (getpoint "\nInsertion point : ")))
(command "-Insert" bn ip "" "" Pause))
(princ)
)
this line : ((setq s ($p str "*A#M##*")) (setq bn (strcat "DIN125A-" s "-E"))) would replace your entire cond function with all the wcmatch's inside it.
But cond function with all the wcmatches inside is OK too , keeps it nice and simple and easy to add future blocknames to it.
In the end its not about what works for me but what best works for you.