Just a small update on my tests:
(setq SS (ssget "_:N" (list (cons 0 "INSERT,ATTRIB,TEXT,MTEXT"))))
This seems to work, however when selecting the whole block ref (in my case its contained of lines and attribute entities) it does not change the subentities,
but it works if I only "window select" the attributes, without any nested lines within the same block reference. Overall theres no problem with combination of non-nested entities.
Thanks Lee, I'll check Tim's thread right now.
EDIT: Okay I wrote something, using Tim's
ssgetNested subr:
(defun C:test ( / LM:flatten *error* acDoc uFlg e o str Lst )
(defun LM:flatten ( l ); Flatten List - Lee Mac ; Transforms a nested list into a non-nested list
(if (atom l) (list l) (append (LM:flatten (car l)) (if (cdr l) (LM:flatten (cdr l)))))
)
(defun *error* ( msg )
(and uFlg (vla-EndUndoMark acDoc))
(princ)
)
(setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setvar 'errno 0)
(while (/= 52 (getvar 'errno))
(setq e (car (nentsel "\nSelect source text/mtext/attrib:" )))
(cond
( (and e (setq o (vlax-ename->vla-object e)) (vlax-property-available-p o 'TextString) (setq str (vla-get-TextString o))) (setvar 'errno 52) )
( T nil )
)
)
(if (and str (princ "\nSelect any nested texts to populate: ") (setq Lst (ssgetNested 0)))
(progn
(vla-EndUndoMark acDoc)
(setq uFlg (not (vla-StartUndoMark acDoc)))
(mapcar
(function (lambda (x) (and (vlax-property-available-p x 'TextString) (vl-catch-all-apply 'vla-put-TextString (list x str)))))
(mapcar 'vlax-ename->vla-object (vl-remove-if-not (function (lambda (x) (= 'ENAME (type x)))) (LM:flatten Lst)))
)
(and uFlg (setq uFlg (vla-EndUndoMark acDoc)))
(vla-Regen acDoc acActiveViewport)
)
)
(princ)
);| defun |; (or vlax-get-acad-object (vl-load-com)) (princ)
It would be nice if he included atleast the SS Window's coords in that list, so one could recreate SS that will proceed the non-nested objects.