rotate 90 keyboard shortcut

rotate 90 keyboard shortcut

Anonymous
Not applicable
9,618 Views
9 Replies
Message 1 of 10

rotate 90 keyboard shortcut

Anonymous
Not applicable
Hi there, I was hoping someone could help me.
I am trying to make a shortcut command in the acad.pgp file that will execute
rotate 0 90

Basically, is there a way to make a one key command to rotate an object 90 degrees? I hate keying in ro click 90 all the time!

I assume I need to write the command as a lisp and then link that to a keyboard shortcut using the pgp file?
I am using ADT 2006

Thanks!
0 Likes
9,619 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
wrote in message news:4922098@discussion.autodesk.com...
Hi there, I was hoping someone could help me.
I am trying to make a shortcut command in the acad.pgp file that will
execute
rotate 0 90

Basically, is there a way to make a one key command to rotate an object 90
degrees? I hate keying in ro click 90 all the time!

I assume I need to write the command as a lisp and then link that to a
keyboard shortcut using the pgp file?
I am using ADT 2006

Thanks!
0 Likes
Message 3 of 10

Anonymous
Not applicable
Patrick, You don't need to edit your pgp
just a simple LISP will do. You could
also use a toolbar macro if you want
to use a button, or you could call your
LISP from a button also. I choose RT
because they're close together. Change
to any letter(s) that are not commands
already.

(defun c:RT()
(command "ROTATE" pause "" pause 90)
)

wrote in message news:4922098@discussion.autodesk.com...
Hi there, I was hoping someone could help me.
I am trying to make a shortcut command in the acad.pgp file that will
execute
rotate 0 90

Basically, is there a way to make a one key command to rotate an object 90
degrees? I hate keying in ro click 90 all the time!

I assume I need to write the command as a lisp and then link that to a
keyboard shortcut using the pgp file?
I am using ADT 2006

Thanks!
0 Likes
Message 4 of 10

Anonymous
Not applicable
Thanks Richard!

That's close to what I am looking for... but the script you suggest still requires you to
a) type RT
b) select the object
c) define a basepoint

I was hoping there might be a way of assigning a lisp command to one of the function keys so that it would work in the following way

a) select objects for rotation
b) hit F3 or F4

and the selected objects automatically rotate by 90 degrees around their local axis ie the same as if you had typed "@0,0,0"

so by adjusting your script, I've got this working...
(defun c:RT()
(command "ROTATE" pause "" "@0,0,0" 90)
)

but it still doesn't work in a noun-verb format...
do I need to assign the current selection to the function somehow?

Thanks for your help!
0 Likes
Message 5 of 10

Anonymous
Not applicable
(defun c:RT()
(setq cEnt (ssget))
(command "ROTATE" cEnt "" "@0,0,0" 90)
)

wrote in message news:4923281@discussion.autodesk.com...
Thanks Richard!

That's close to what I am looking for... but the script you suggest still
requires you to
a) type RT
b) select the object
c) define a basepoint

I was hoping there might be a way of assigning a lisp command to one of the
function keys so that it would work in the following way

a) select objects for rotation
b) hit F3 or F4

and the selected objects automatically rotate by 90 degrees around their
local axis ie the same as if you had typed "@0,0,0"

so by adjusting your script, I've got this working...
(defun c:RT()
(command "ROTATE" pause "" "@0,0,0" 90)
)

but it still doesn't work in a noun-verb format...
do I need to assign the current selection to the function somehow?

Thanks for your help!
0 Likes
Message 6 of 10

Anonymous
Not applicable
this will add a test similar to nour/verb

(defun c:RT (/ cEnt)
(setq cEnt (ssget))
(if (null cEnt)
(setq cEnt (entget "\n Select Objects: "))
)
(command "ROTATE" cEnt "" "@0,0,0" 90)
)

"Paul Richardson" wrote in message
news:4923286@discussion.autodesk.com...
(defun c:RT()
(setq cEnt (ssget))
(command "ROTATE" cEnt "" "@0,0,0" 90)
)

wrote in message news:4923281@discussion.autodesk.com...
Thanks Richard!

That's close to what I am looking for... but the script you suggest still
requires you to
a) type RT
b) select the object
c) define a basepoint

I was hoping there might be a way of assigning a lisp command to one of the
function keys so that it would work in the following way

a) select objects for rotation
b) hit F3 or F4

and the selected objects automatically rotate by 90 degrees around their
local axis ie the same as if you had typed "@0,0,0"

so by adjusting your script, I've got this working...
(defun c:RT()
(command "ROTATE" pause "" "@0,0,0" 90)
)

but it still doesn't work in a noun-verb format...
do I need to assign the current selection to the function somehow?

Thanks for your help!
0 Likes
Message 7 of 10

Anonymous
Not applicable
Paul,
thanks again for your input.

Two more questions. 🙂

Is there a way for the command to keep the previous selection, so that you can keep hitting the shortcut key without having to reselect the object? (I can't believe there's not a script that does this already available!)

and, I'm having trouble working out how to have the script autoload on drawing-open. With previous versions of acad-lt(with extender and express), we used a 2000support.lsp file to pre-load all the lisp commands. This doesn't seem to be set-up in the latest version we are running (LT2005 with extender and express). What can I do to make acad autoload the lisp?

Many thanks.
0 Likes
Message 8 of 10

Anonymous
Not applicable
Oh, on a quick search I found what I needed for autoload...

so I placed acaddoc.lsp in the acad root folder, and it loaded it automatically.

The strange thing is, now when I run the lsp with nothing selected, I get an error message:

; error : bad argument type <"
Select Objects: "> ; expected ENTITYNAME at [ENTGET]

Any ideas?
0 Likes
Message 9 of 10

Anonymous
Not applicable
I use acad.lsp to load my lisps although acaddoc.lsp
should work. Save your txt file as acad.lsp and place
it in your support directory. Set the system variable
ACADLSPASDOC to 1 so this file will load with
each new drawing.

This is not exactly what you want but all I have time
for right now. You should change the post to the
customization group if you have more questions,
you will also get more answers that way. I will look
back at it later if this does not work the way you want.

gl
Paul

;
(defun c:RT (/ cEnt)
(setq cEnt (ssget))
(if (null cEnt)
(setq cEnt (entget "\n Select Objects: "))
)

(command "ROTATE" cEnt "" "@0,0,0" 90)

(while
(or (initget "Y")
(/= "N"
(setq response (getkword "\nRotate again? (Y/ESC): "))
(command "ROTATE" "P" "" "@0,0,0" 90)
)
)
)
)
;



wrote in message news:4923495@discussion.autodesk.com...
Oh, on a quick search I found what I needed for autoload...

so I placed acaddoc.lsp in the acad root folder, and it loaded it
automatically.

The strange thing is, now when I run the lsp with nothing selected, I get an
error message:

; error : bad argument type <"
Select Objects: "> ; expected ENTITYNAME at [ENTGET]

Any ideas?
0 Likes
Message 10 of 10

TexShalter
Advocate
Advocate

Unless I didn't understand your question...

I just added this near the bottom of my acad.lsp:

 

You may have already assigned the numbers 1 thru 0 to other commands 

 

(defun c:1 () (command "_.rotate" pause"" "@" "22.5"))
(defun c:3 () (command "_.rotate" pause"" "@" "30"))
(defun c:4 () (command "_.rotate" pause"" "@" "45"))
(defun c:5 () (command "_.rotate" pause"" "@" "315"))
(defun c:6 () (command "_.rotate" pause"" "@" "60"))
(defun c:8 () (command "_.rotate" pause"" "@" "180"))
(defun c:9 () (command "_.rotate" pause"" "@" "90"))
(defun c:0 () (command "_.rotate" pause"" "@" "270"))