Try this
; copy an object to multi rectangs
; based on Lower Right cnr of rectang
; By AlanH Jan 2021
(defun c:test ( / ss lst co-ord ent pt x )
(setq ss (ssget (list (cons 0 "LWpolyline")))) ; select all the rectangs 1st
(setq lst '())
(repeat (setq x (sslength ss))
(setq ent (ssname ss (setq x (- x 1))))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent))))
(setq co-ord (vl-sort co-ord
'(lambda (a b)
(cond
((< (car a) (car b)))
((= (car a) (car b)) (< (cadr a) (cadr b)))
)
)
))
(setq pt (list (car (nth 2 co-ord))(cadr (nth 2 co-ord)) 0.0))
(setq lst (cons pt lst))
)
(princ "\n")
(princ "\nSelect objects to copy ")
(setq ss (ssget)) ; select all the objects to copy
(setq pt (getpoint "\nPick base point LR ? "))
(repeat (setq x (length lst))
(setq pt2 (nth (setq x (- x 1)) lst))
(command "copy" ss "" pt pt2)
)
(princ)
)