Hi,
You can use a reactor
;;;=================================================================
;;;
;;; JSD.LSP V2.00
;;;
;;; Jeu de Sélection de ce qui a été créé
;;;
;;; Copyright (C) Patrick_35
;;;
;;;=================================================================
(defun commencer_jeu__selection(Rea Cde)
(if (member (car Cde) '("COPY" "MIRROR" "GRIP_MIRROR" "ARRAY"))
(setq $ (ssadd))
)
)
(defun ajouter_jeu_de_selection (Rea Obj)
(if (not (eq (cdr (assoc 0 (entget (cadr Obj)))) "ATTRIB"))
(ssadd (cadr Obj) $)
)
)
(defun enlever_jeu_de_selection (Rea Obj)
(ssdel (cadr Obj) $)
)
(defun faire_jeu_de_selection()
(setq mrea_jsd (vlr-command-reactor nil (list (cons :vlr-commandWillStart (function commencer_jeu__selection))
)
)
mrea_fin (vlr-acdb-reactor nil (list (cons :vlr-objectAppended (function ajouter_jeu_de_selection))
(cons :vlr-objectUnErased (function ajouter_jeu_de_selection))
(cons :vlr-objectErased (function enlever_jeu_de_selection))
)
)
)
(princ "\nSelection of what is created ready, use !$ at the command line.")
(princ)
)
(vl-load-com)
(if (not mrea_jsd)
(faire_jeu_de_selection)
)
(princ)
But I have a problem.
When I do for example a copy of objects of which there are blocks with attributes, a (sslength $) gives me well what was copied.
I make a undo and it's always good.
Now, if I do a MREDO, I have the surprise to discover that the result of (sslength $) corresponds to the number of objects which had been copied more the number of attributes.
I seek in vain from where the error can come and I do not find
@+