attribute rotation

was I dreaming?

I seem to remember just a week or two ago I finally figured out how to rotate just the attributes in a block. never used attributes much because they rotated with the block and I was too dumb to make them read "right".

it might have been a command, it could have been lisp. don't remember.

was I dreaming?

Reply to
Roy Knapp
Loading thread data ...

I do not recall where I picked this up but it works for me. hth Brian

;;; Attrot.lsp * ;;; Rotate attributes. Pick attributes one by one and rotate them * ;;; to an absolute angle. *

(defun C:ATTROT (/ ent entl alist ahdl ang) (initget " ") (while (and (setq ent (nentsel "\nPick an attribute: ")) (/= ent "")) (if (and ent (/= ent "")) (progn (setq entl (entget (car ent))) (if (/= (cdr (assoc 0 entl)) "ATTRIB") (setq ent nil) (if (not (member (setq ahdl (cdr (assoc 5 entl))) alist)) (setq alist (cons ahdl alist)) ) ) ) (setq ent nil) ) (initget " ") ) (if alist (setq ang (getangle "Specify new rotation angle: ")) ) (while alist (setq ent (handent (car alist)) entl (entget ent) ) (entmod (subst (cons 50 ang) (assoc 50 entl) entl)) (entupd ent) (setq alist (cdr alist)) ) )

Reply to
Brian Spillane

Since the routine only allows single item selection, I can't see why this is better than the native ATTEDIT command. ATTEDIT allows (clunky) selection of multiple atts and can be easily incorporated into a custom routine to streamline that limitation. It also allows keyboard angle specification.

MichaelB

formatting link

----- Original Message ----- From: "Brian Spillane" Newsgroups: alt.cad.autocad Sent: Saturday, July 10, 2004 10:45 PM Subject: Re: attribute rotation

Reply to
Michael Bulatovich

Here is one more option. This is what I use for rotating attributes. Just select the attributes you want to rotate and type in the new angle. I don't have any problems with it but be forwarned it doesn't have any error checking.

Regards, LT

(DEFUN C:ATTROT(/ SELSET X ENT ENTG ATT ATTG OLDROT NEWROT NEWATTG ANGL) (DEFUN DTR (D)(/ (* PI D) 180))

(SETQ SELSET (SSGET)) (SETQ ANGL (DTR (GETREAL "New rotation angle for attributes: "))) (SETQ X 0)

(REPEAT (SSLENGTH SELSET) (SETQ ENT (SSNAME SELSET X)) (SETQ ENTG (ENTGET ENT)) (SETQ ATT (CDR (ASSOC -1 ENTG)))

(WHILE (/= (CDR (ASSOC 0 (ENTGET (SETQ ATT (ENTNEXT ATT))))) "SEQEND") (PRINC (STRCAT "\n" (CDR(ASSOC 0 (ENTGET ATT))))) (IF (= (CDR(ASSOC 0(ENTGET ATT))) "ATTRIB") (PROGN (SETQ ATTG (ENTGET ATT)) (SETQ OLDROT (ASSOC 50 ATTG)) (SETQ NEWROT (CONS 50 ANGL)) (SETQ NEWATTG (SUBST NEWROT OLDROT ATTG)) (ENTMOD NEWATTG)(ENTMOD ENTG) ) )

);WHILE (SETQ X (1+ X)) );REPEAT

);ROTATTS

Reply to
Larry Travis

If you're working in full blown, there's a second tab called "text options" in your standard attribute editor - this will allow you to change angle.

If you're using LT then you need the -ATTEDIT command on the command line. Keep on hitting enter until you're promted to "select object," then select as many attributed as you want to edit, press enter when you're done. You're then promted to select an editing option (height, angle, position, or value) or to go to the next attribute in your selection (exits the command if you've run out of selected attributes).

Hope this helps, you can add a line in one of your menus that can jump straight to the "select objects" bit if you want to. I can't remember the code now, but will post it tomorrow...

Reply to
Daniel J. Ellis

This can be put into a button to rotate ONE attribute to zero angle in the current UCS:

attedit;;;;;\;a;0;;

Reply to
Michael Bulatovich

I use this due to I only rotated some of the blocks. I am doing photo locations for bridge and/or building reports and need to drop in a block with the photo number. Approx. where from and to point in direction of photo. With the bridge photos I am using your "bseq" routine then fix the attribute. I can select ALL the desired blocks (albeit individually picked no window option) and change all attributes to 0 degrees. This suits my needs fine, as I don't want all the attributes rotated.

Thanks again for bseq

Brian

Reply to
Brian Spillane

Oh.

Reply to
Michael Bulatovich

Ah. I'd tried that and couldn't get it to work. I think I was short by a couple of semi-colons. :-(

Reply to
Daniel J. Ellis

A semicolon equals an "Enter". When you program a button just transcribe exactly your keystrokes. Remember that some commands will have a different set of prompts depending on the setting of the EXPERT sysvar. (eg....Are you sure you want to do what you said? /N:)

Reply to
Michael Bulatovich

I knew that. I guess I just miss-counted :-(

Thanks anyway. the other guys in the office might appreciate it....

Reply to
Daniel J. Ellis

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.