Let's say that I select a bunch of stuff and copy it. I want to make a selection set
of the new stuff created by the copy command.
Thanks for any and all suggestions. :
|
Let's say that I select a bunch of stuff and copy it. I want to make a selection set
of the new stuff created by the copy command.
Thanks for any and all suggestions. :
You can use this
Code:;;============================================================ ; Rune Wold and Michael Puckett - modified ; e.g. usage (setq marker (ALE_LASTENT)) ;; Function to get the absolute last entity in the database ;; Returns nil is drawing is completely empty (defun ALE_LastEnt ( / EntNam OutVal) (and (setq OutVal (entlast)); if there is an entity in drawing (while (setq EntNam (entnext OutVal)) (setq OutVal EntNam) ) ) OutVal ) ;;============================================================ ;; Function to get new items after EntNam in the database (defun ALE_Ss-After (EntNam / EntNxt SelSet) (cond ( (not EntNam) (ssget "_X") ); dwg was empty ( (setq EntNxt (entnext EntNam)); get new items (setq SelSet (ssadd EntNxt)) (while (setq EntNxt (entnext EntNxt)) (if (entget EntNxt) (ssadd EntNxt SelSet)) ) SelSet ) ) ) ;========================================================= ;;===================================================================== ;;=================== Code to get New objects ======================== ;;===================================================================== (setq elast (ALE_LastEnt)); get last entity in database (setq newbies (ssadd)) ; create an empty selection set ;; ;; Do your array or paste command ;; (setq newbies (ALE_Ss-After elast)) ;; newbies is a selection set of all items created by your command. ;;=====================================================================
Last edited by CAB2k; 2007-03-27 at 12:56 PM.
Thanks. I'll give it a try next week.
how about
(setq sel (ssget))
(command "copy" sel "" "0,0" "0,0" "move" "P" "" pause pause)
(setq sel2 (ssget "p"))
No point, really .. sel2 will contain the same selection as sel. I see only two ways, one of which is given above by Ab2draft. The other way is using the ActiveX methods Copy and CopyObjects, which will both return the copied object(s).Originally Posted by eddyhgng
HiOriginally Posted by stig.madsen
Have you actually tried what "eddyhgng" posted, I think you might be surprised....
Have a good one, Mike
I was surprised, it did work. Not sure I understand why?
Yes, line by line. It moves the original objects so that it appears to be the new objects being selected .. kinda like an optical illusion.Originally Posted by Mike.Perry
Hi StigOriginally Posted by stig.madsen
Can you please explain, you've lost me (not difficult I know).
Mike
Reply to Eddyhgng:
Thanks for your input.
What I'm trying to do is create a rector(this part is done) that reacts on the copy command.
It will then iterate through all of the new objects created by said command to check for blocks of a particular name.
I should be able to incorporate the code AB2DRAFT to make this happens.
Your code is valid but I don't wan't to redefine the copy command.