Quick rotate and / or move-rotate

Quick rotate and / or move-rotate

Anonymous
Not applicable
2,893 Views
12 Replies
Message 1 of 13

Quick rotate and / or move-rotate

Anonymous
Not applicable

Hi,

 

I'd put this in the wrong area apparently so, here goes here..... 🙂

 

I am after a couple command if anyone knows of one please, to:

 

1) Quick rotate text - in other words, simply click the text and click somewhere in space to rotate it. It will always automatically use it's insert point as the base point. and:

 

2) Quick move and rotate - similarly, select text, place somwhere, then click in space for it's orientation. Always using insert point as base point. IE without having to move/enter/select/enter/base point/destination/rotate/enter/base/rotation.

 

If anyone can help, that would certainly be great!

 

Thanks 🙂

 

Rroger_D

0 Likes
Accepted solutions (2)
2,894 Views
12 Replies
Replies (12)
Message 2 of 13

Kent1Cooper
Consultant
Consultant

Those would not be difficult to build, but how about just using GRIPS?  This is just what they're for.  In your first instance, pick the Text, pick on its insertion-point Grip, hit Enter twice to get to Rotate mode, pick your point to designate the rotation.  In the second instance, pick the Text, pick on its insertion-point Grip, drag it to where you want it to be, pick on the Grip again, hit Enter twice to get to Rotate mode, pick your point to designate the rotation.  There are slightly more picks involved than in the process you describe, but at least one fewer to compensate, since there is no pick on a menu item nor entering of a command name required, and no code is required at all.  Do it a few times, and it will become second-nature and very quick.

Kent Cooper, AIA
0 Likes
Message 3 of 13

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

Hi,

 

I'd put this in the wrong area apparently so, here goes here..... 🙂

 

I am after a couple command if anyone knows of one please, to:

 

1) Quick rotate text - in other words, simply click the text and click somewhere in space to rotate it. It will always automatically use it's insert point as the base point. and:

 

...


I have quite complex routine of my own for this task. Maybe to complex... Read couple of first lines where are some comments...
This routine works for single selection or multiple... If you have multiple selection that you can decide how to thread this that - as group with reference point in the middle (commands 0,5,8....) or use those individual insert points (commands 00, 55, 88...)

 

PS. Since Kent Cooper probably reading this, so special thanks to you, because I'm here used part of your routine.

0 Likes
Message 4 of 13

Anonymous
Not applicable

Hi Mr Cooper,

 

Thank you very much for your prompt reply.

 

Someone did mention grips and I have just tried what you suggest with some trial data. Unfortunately it still seems too cumbersome for what I need. I have literally thousands of text entries to manipulate per drawing (30k+)

 

With your suggestion, per text element, I have to:

click (select), click (grip), enter, enter, rotate & escape then move on to the next and repeat.

 

I was hoping instead per text element, for:

click (select), rotate, right-click (repeat).

 

Half the operations, twice the productivity, hopefully.

 

Thank you for your response though anyway.

 

I do have a Lisp that was given to me to work with rotating block references in the same manner. I just have no idea how Lisps work to be able to swap the block for text. Any ideas if I PM it to you? or post on here with the originators acknowledgements?

 

Cheers,

 

Rroger_D

 

 

 

 

 

0 Likes
Message 5 of 13

Anonymous
Not applicable

Hi BeeKeeCZ,

 

Wow! You're not wrong, that is complicated! 🙂

 

The one I was given (Thank you to Lee Mac of http://www.theswamp.org/), works for block references:

 

 

(defun c:br ( / ent enx )
(while
(progn (setvar 'errno 0) (setq ent (car (entsel "\nSelect block: ")))
(cond
( (= 7 (getvar 'errno))
(princ "\nMissed, try again.")
)
( (null ent) nil)
( (/= "INSERT" (cdr (assoc 0 (setq enx (entget ent)))))
(princ "\nSelected object is not a block.")
)
( t
(vl-cmdf "_.rotate" ent "" "_non" (trans (cdr (assoc 10 enx)) ent 1))
(while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\"))
nil ;; exit loop
)
)
)
)
(princ)
)

 

Type command (BR), select block, point rotate. Repeat.

 

If someone can ammend for single-line text perhaps....?

 

To incorporate also the move command, I assume with be similar and insert at the beginning:

 

command (mr), select, drop, rotate, repeat

 

Any thoughts?

 

Thanks.

 

Rroger_D

0 Likes
Message 6 of 13

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

Hi BeeKeeCZ,

 

Wow! You're not wrong, that is complicated! 🙂

 


Its just complex! 🙂

 

Imagine your Numpad as clocks. So 0 is horizontal. 8 is vertical. 6 is rotate +90degrees, 4 is -90 digrees. 5 is free... (by selection - my favourite. You can select line, pline, text, what ever defines an angle).

If si prefere rotations with its inserts points... just change 00 to 0, and in front of current 0 make semicolon.

 

0 Likes
Message 7 of 13

ВeekeeCZ
Consultant
Consultant
Accepted solution

Ok, I modified Lees routine for you. Works with TEXT, MTEXT and Blocks.

 

Spoiler
(defun c:tr (/ ent enx)
  (while
    (progn (setvar 'errno 0)
	   (setq ent (car (entsel "\nSelect block or (m)text: ")))
	   (cond
	     ((= 7 (getvar 'errno))
	      (princ "\nMissed, try again.")
	     )
	     ((null ent) nil)
	     ((not (wcmatch (cdr (assoc 0 (setq enx (entget ent)))) "INSERT,*TEXT" ))
	      (princ "\nSelected object is not a block or (m)text.")
	     )
	     (t
	      (vl-cmdf "_.rotate"
		       ent
		       ""
		       "_non"
		       (trans (cdr (assoc 10 enx)) ent 1)
	      )
	      (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\"))
	      nil
	      ;; exit loop
	     )
	   )
    )
  )
  (princ)
)
Message 8 of 13

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...

 

2) Quick move and rotate - similarly, select text, place somwhere, then click in space for it's orientation. Always using insert point as base point. IE without having to move/enter/select/enter/base point/destination/rotate/enter/base/rotation.

...


Did you tried MOCORO express command?

0 Likes
Message 9 of 13

Anonymous
Not applicable

FAB!!

 

Works exactly as expected! Cheers.

 

Do you fancy adding in the move command as well, or is that being too cheeky   😉

 

I'm also trying to get to the bottom of an auto text-delete problem as well..... but that's another story (post).

 

BIG thanks!

 

Rroger_D

0 Likes
Message 10 of 13

Anonymous
Not applicable

I found the MOCORO command a little clumsy. This Lisp is spot-on.

 

Cheers.

0 Likes
Message 11 of 13

Kent1Cooper
Consultant
Consultant

@ВeekeeCZ wrote:

Ok, I modified Lees routine for you. Works with TEXT, MTEXT and Blocks.

....

  (trans (cdr (assoc 10 enx)) ent 1)

....

 

That has the same potential problem as in a couple of other recent threads.  It will Rotate plain Text around the left end of its baseline, no matter what its justification.  If you want it Rotated around its insertion point [what Osnap INS would snap to], whether that's the same as the left end of the baseline [Left-justified only] or different [any other justification], you need to choose between the 10 and 11 entity-data entries.  One way:

 

  (trans

    (cdr ; get the point from:

      (assoc

        (if

          (and

            (member '(0 . "TEXT") enx); plain Text

            (not (and (member '(72 . 0) enx) (member '(73 . 0) enx))); other than Left-justified

          ); and

          11 ; then

          10 ; else [Mtext or Block or Left-justified Text]

        ); if

        enx

      ); assoc

    ); cdr

    ent 1

  ); trans

 

If you can be reasonably certain nothing else with an INSertion Osnap location will be closer to the pick point than the intended object, you could presumably use an (osnap) function to grab the INSertion point instead, which wouldn't care about this difference, and would be applicable to any of the entity types.

Kent Cooper, AIA
0 Likes
Message 12 of 13

ВeekeeCZ
Consultant
Consultant
Accepted solution

@Anonymous wrote:

 

Do you fancy adding in the move command as well...

 


Ok, and with Kents suggestion of enhancement... 

 

Spoiler
(defun c:tmr (/ ent enx)
  (while
    (progn (setvar 'errno 0)
	   (setq ent (car (entsel "\nSelect block or (m)text: ")))
	   (cond
	     ((= 7 (getvar 'errno))
	      (princ "\nMissed, try again.")
	     )
	     ((null ent) nil)
	     ((not (wcmatch (cdr (assoc 0 (setq enx (entget ent))))
			    "INSERT,*TEXT"
		   )
	      )
	      (princ "\nSelected object is not a block or (m)text.")
	     )
	     (t
	      (vl-cmdf "_.move"
		       ent
		       ""
		       "_non"
		       (trans
			 (cdr		; get the point from:
			   (assoc
			     (if
			       (and
				 (member '(0 . "TEXT") enx)
					; plain Text
				 (not (and (member '(72 . 0) enx)
					   (member '(73 . 0) enx)
				      )
				 )	; other than Left-justified
			       )	; and
				11	; then
				10	; else [Mtext or Block or Left-justified Text]
			     )		; if
			     enx
			   )		; assoc
			 )		; cdr
			 ent
			 1
		       )		; trans
		       PAUSE
	      )
	      (setq enx (entget ent))
	      (vl-cmdf "_.rotate"
		       ent
		       ""
		       "_non"
		       (trans
			 (cdr		; get the point from:
			   (assoc
			     (if
			       (and
				 (member '(0 . "TEXT") enx)
					; plain Text
				 (not (and (member '(72 . 0) enx)
					   (member '(73 . 0) enx)
				      )
				 )	; other than Left-justified
			       )	; and
				11	; then
				10	; else [Mtext or Block or Left-justified Text]
			     )		; if
			     enx
			   )		; assoc
			 )		; cdr
			 ent
			 1
		       )		; trans
	      )
	      (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\"))
	      nil
	      ;; exit loop
	     )
	   )
    )
  )
  (princ)
)
Message 13 of 13

Anonymous
Not applicable

Hi BeeKeeCZ,

 

Absolutely spot on! Thanks!

 

On repetition, this reduces the number of clicks from 15 (standard ACad commands), to 3. Now that is efficient!

 

BIG thank you's and Kudos to boot.

 

Rroger_D

 

0 Likes