Author Topic: rotate 90 degree command?  (Read 5683 times)

0 Members and 1 Guest are viewing this topic.

knosaj

  • Guest
rotate 90 degree command?
« on: January 15, 2011, 07:43:29 PM »
in vectorwroks there is a command that will just rotate the object everytime you hit...say "alt/sft/R" (or whatever)

is there any command in cad that will jsut rotate said object w/o having to hit ro/enter, then use the tool....sort of like the copy/paste command set is started and completed with only keys.

id like to, if an object needs to be rotated 270 degrees, i can just hit, "this set of keys" 3 times to get it right.

-make any sense?

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: rotate 90 degree command?
« Reply #1 on: January 16, 2011, 10:20:58 AM »
one could write a macro/toolbar command

OR

just toggle on the Ortho lock command...

select the object
pick a Grip (basepoint of rotation)
Rt-Click
Select Rotate
then move the mouse...ONLY 90 degree increments will be available (unless you have set optional polar tracking values)

OR

select the object
pick a Grip (basepoint of rotation)
tap Space Bar twice, this sets the grip edit mode to rotate
move the mouse as above.
« Last Edit: January 16, 2011, 10:15:01 PM by Higgs Boson's Mate »
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: rotate 90 degree command?
« Reply #2 on: January 16, 2011, 05:24:12 PM »
Pointless coding...

Code: [Select]
(defun c:r90 ( / a b c d ) (vl-load-com)
  (if (setq a (ssget "_:L"))
    (progn
      (vlax-for b
        (setq c
          (vla-get-ActiveSelectionSet
            (vla-get-ActiveDocument
              (vlax-get-acad-object)
            )
          )
        )
        (setq d (cons b d))
      )
      (vla-delete c)
      (
        (lambda ( f )
          (mapcar
            (function
              (lambda ( a )
                (if (vlax-method-applicable-p a 'Rotate)
                  (vla-rotate a f (/ pi 2.))
                )
              )
            )
            d
          )
        )
        (
          (lambda ( e )
            (vlax-3D-point
              (mapcar '(lambda ( a b ) (/ (+ a b) 2.0))
                (apply 'mapcar (cons 'min e))
                (apply 'mapcar (cons 'max e))
              )
            )
          )
          (apply 'append
            (mapcar
              (function
                (lambda ( a / b c )
                  (if (vlax-method-applicable-p a 'getboundingbox)
                    (mapcar 'vlax-safearray->list
                      (progn
                        (vla-getboundingbox a 'b 'c) (list b c)
                      )
                    )
                  )
                )
              )
              d
            )
          )
        )
      )
    )
  )
  (sssetfirst nil a) (princ)
)

But I had fun  :-)

BlueMoon

  • Guest
Re: rotate 90 degree command?
« Reply #3 on: January 24, 2011, 04:42:22 PM »
You can also do the same thing as Higgs 2nd suggestion but instead of toggling on the ortho just hold down the shift key.  Sometimes that's quicker.

BM

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: rotate 90 degree command?
« Reply #4 on: January 24, 2011, 05:09:06 PM »
Modeled after a macro I use at least once a day:
Code: [Select]
(defun c:RR (/ ss pt)
  ;; Rotate selected object(s) 180°
  ;; Alan J. Thompson
  (if (and (princ "\nSelect object(s) to rotate 180°: ")
           (setq ss (ssget "_:L"))
           (setq pt (getpoint "\nSpecify rotation base point: "))
      )
    (command "_.rotate" ss "" "_non" pt 180.)
  )
  (princ)
)

You could do something like this:
Code: [Select]
(defun c:R90 (/ ss pt)
  (if (and (princ "\nSelect object(s) to rotate 90°: ")
           (setq ss (ssget "_:L"))
           (setq pt (getpoint "\nSpecify rotation base point: "))
      )
    (progn
      (command "_.rotate" ss "" "_non" pt 90.)
      (while (/= "No"
                 (progn (initget "Yes No")
                        (getkword "\nRotate additional 90°? [Yes/No] <Yes>: ")
                 )
             )
        (command "_.rotate" ss "" "_non" pt 90.)
      )
    )
  )
  (princ)
)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox