Friday, February 18, 2011

Rotating Block Attributes Lisp

Here's a LISP routine I use all the time when I have a attributed block that has to be rotated. What happens is that the attribute rotates with it. To rotate the attribute back without rotating the block I use this LISP. I wish i could remember where I got, so I could credit the writer. Where ever you are... Thanks for the great LISP.

2 comments:

W. Kiernan said...

I've got a program I've been using since about 1993 which does the same sort of thing, moves or rotates ATTRIBs relative to the INSERT to which they're attached. Select the INSERT

(setq iname (entsel "\nSelect an INSERT: "))

and save its entity data (the entity data for the INSERT, you don't have to look at the ATTRIBs or SEQEND entities)

(if iname
  (progn
    (setq iname (car iname))
    (setq idata (entget iname))
...
  )
)

Next use the MOVE, ROTATE, SCALE, etc. commands to adjust the INSERT to taste. After you're done with all that, restore the original entity data for the INSERT itself

(entmod idata)
(entupd iname)

The ATTRIBs will still be moved, rotated and scaled as you saw on the screen, but the INSERT itself is restored to the location, rotation, scale factor, etc. as it originally was.

Todd M. Shackelford said...

Cool!