Rotate attributes selected blocks to horizontal equal to WCS/ UCS view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody,
I am using the lisp below to rotate the attributes of a block automatically to horizontal in the current view (WCS or UCS) if I rotate a block. But now I have to rotate the attributes of multiple blocks to horizontal only.
We have received many drawings from third parties. In these drawings, one block and his attributes are rotated 45 degrees, the other 63 degrees etc. The blocks and attributes do have a lot of different angles. The position/ rotation of these blocks are oke.
I can use my own lisp by selecting all these blocks, select a basepoint, rotate them for example 90 degrees, and after that, rotate them 270 degrees. All the attributes are placed horizontal now.
But is there somebody who can help me with a lisp which only rotates the attributes of the selected blocks to horizontal or (for maybe in the future) to another angle/ let me choose from 2 options, horizontal or angle.
A lisp that ensures that I don't have to rotate everything twice.
Thanks
(defun c:RB ( / ss i vla-blockent)
(if (setq ss (ssget "_:L"))
(progn
(command "_.ROTATE" ss "")
(while (> (getvar 'CMDACTIVE) 0)
(command PAUSE))
(repeat (setq i (sslength ss))
(setq vla-blockent (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
(if (eq (vla-get-hasattributes vla-blockent) :vlax-true)
(foreach att (vlax-invoke vla-blockent 'getattributes)
(vla-put-rotation att 0)))))
(princ "\nNothing selected."))
(princ)
)
(vl-load-com)