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

When defining a macro, how to represent a SHIFT key stroke

3 REPLIES 3
Reply
Message 1 of 4
brucejwangtaiwan
279 Views, 3 Replies

When defining a macro, how to represent a SHIFT key stroke

Hello,

 

With interactive manipulation, I can Ctrl+A, then Shift, then use mouse to specify a rectangular area, then Del to erase everything outside the rectangular area. I must use Ctrl+A instead of Select command because Ctrl+A can pick up unseen objects which Select All can not.

 

Now that I want to make the serial manipulation into a macro. I found Ctrl+A to be ai_selall but how to represent Shift key stroke in a macro?

 

 

Regards,

 

Bruce 

3 REPLIES 3
Message 2 of 4
doni49
in reply to: brucejwangtaiwan

You are correct that Select All will not select Unseen objects.

 

But the following WILL.  This is technically AutoLISP code but that doesn't prohibit you from using it in a macro or script (you could just as easily type it at the command line).  This will select EVERYTHING in the current dwg file regardless of what "space" it's in -- Model Space, Paperspace and All layout tabs.

 

(ssget "x")

 



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 3 of 4
brucejwangtaiwan
in reply to: doni49

Hi Don,

 

 

I then want to specify a rectangular area with lower left coner at 0,0 and upper right coner at 841,594, then delete everything (ssget "x") picks up but only outside that rectangular.

 

How to write such a macro?

 

Thanks,

 

Bruce

Message 4 of 4
doni49
in reply to: brucejwangtaiwan

I think you're better off doing this with an AutoLISP routine.

Go to afralisp.net and search for ssget. There are LOTS of helpful options. I would have it create two selection sets. One using the X option and the other by window selection (if memory serves, you're looking for W instead of X). Now run (command "e" entsel1 "r" entsel2 "" ).

That will start the erase command, select everything from the X option then REMOVE everything picked up in the W option.

Note: the following will store your ssget selections in the appropriate variables.

(Setq entsel1 (ssget "X"))

Don Ireland
Sent from my Android device with K-9 Mail. Please excuse my brevity.


Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

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

Post to forums  

Autodesk Design & Make Report

”Boost