Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting a Selection Set after Paste

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
1228 Views, 8 Replies

Getting a Selection Set after Paste

Hey Gang

 

Tried a search found nothing.  Is it possible to get a selection set of what was just pasted into drawing?  Thanks

 

Southie

8 REPLIES 8
Message 2 of 9
devitg
in reply to: Anonymous

select 

p

 

Message 3 of 9
3wood
in reply to: Anonymous

Instead of Ctrl+V, use Ctrl+Shift+V to paste as a block. Then explode it with "L" selection. Now you have pasted objects in "P" selection.

Message 4 of 9
Anonymous
in reply to: Anonymous

Dev

 

Tried (ssget "P"))  I think i see what you mean even though the sel set is not the entities after paste but what was origanaly selected.  In my case this will work but if i wanted to get the new handles after pasting not sure on that.

 

Thanks

Southie

Message 5 of 9
Anonymous
in reply to: 3wood

3wood

 

Can what you recomended be done thru code?  Would like user to just use pasteclip and just drag to where the want it?

 

Thanks

Southie

Message 6 of 9
Anonymous
in reply to: Anonymous

3wood

 

Got your idea.  User can choose paset as block instead of just paste.  Thanks again. 

Message 7 of 9
3wood
in reply to: Anonymous

If using lisp code, you can record the last entity handle before pasting. Then after pasting, go through entire entity database from the latest entity, comparing with previous record, if is newer, add it to a selection.

Message 8 of 9
Kent1Cooper
in reply to: 3wood


@3wood wrote:

If using lisp code, you can record the last entity handle before pasting. Then after pasting, go through entire entity database from the latest entity, comparing with previous record, if is newer, add it to a selection.


I think the same can be accomplished without making any comparisons of one thing with another to figure out which is newer -- you should be able to just go to the next until there aren't any more.  I'm not in a place where I can test it, but try something like this:

 

(defun C:PandSS (/ entl ent); = Paste and turn into Selection Set
  (setq
    entl (entlast); last object in drawing prior to Paste
    pss (ssadd); = Pasted-objects Selection Set [initially empty]
  ); setq
  (command "_.pasteclip")
  (while (> (getvar 'cmdactive) 0)
    (command pause); allows possible scale/rotation options as well as insertion point
  ); while
  (while (setq ent (entnext entl)); as long as there's still another object
    (ssadd ent pss); put it in the selection
    (setq entl ent); make object just added the base to look for the next after [if any]
  ); while
); defun

That should leave the pasted objects all saved into the 'pss' selection-set variable, to do with whatever you want.

Kent Cooper, AIA
Message 9 of 9
Anonymous
in reply to: Kent1Cooper

All thanks for the help.  Learning all the time.

 

Southie

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost