attributes, still

ATTROT.lsp works, but I get lost in the looping trying to figure out the code.
I want to change the rotation of attributes to zero without so many picks.
But generically, can I select a block and get the entity names of the attributes associated to it?
If I could do that, I could make a selection set of block entities and edit the set and have all my work done in one step.
I have tried the -attedit command.I can change rotation of attributes one at a time, but not globally.
thanks.
roy
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
So you're trying to modify ATTROT to do more than one att in a selection set?
--


MichaelB
www.michaelbulatovich.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
So you're trying to modify ATTROT to do more than one att in a selection set?

that would be one thing.
I tweaked it so that it sets the rotation to zero without my help, but I still have to select attributes individually.
I am working on eleven pages of fire alarm where the wings of the building are set at 45 degrees on one end and 20 degrees on the other. there are a couple thousand devices all told, at various rotations.
I am working for the contractor doing the installation, preparing shop drawings based on the engineer's plans. I think if the engineer had had to show what I am adding, he would have organized his drawing, well, differently.
but it is an opportunity for me work with attributes enough to get well acquainted with them. been using autocad since before paper space, and have not found purpose enough to use them.
I could serve my purposes with simple text, but I get the feeling that I am missing whatever benefit attributes were intended for. I think I can extract the att info to an ASCII file and read it into a spread sheet.actually,I have experimented with that end of it. If I succeed at that, I can easily verify that there are no duplicate device numbers.
better yet, get the point locations of device number attributes, maybe draw a polyline following the points in the order I desire, and read in the values I want for device numbers as exported from the spread sheet file. then I coud just do a fill column in the spread sheet and not type any of the text in cad.
cool?
(I like it when the computer does the grunt work)
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Try this one
;;;;;; lisp START
;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;Drazen Halambek, Zagreb, Croatia ;;;This routine rotates all ATTRIB's of a specified block name to 0.0 ;;;;;;;;;;; call it with (rotatt "BLOCKNAME") ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun rotatt (blockname / skup_a blockname ii e_name e_list cont old_al n_al) (setq skup_a nil) (setq skup_a (ssget "X" (list (cons 2 blockname)))) (setq ii 0) (while (< ii (sslength skup_a)) (progn (setq e_name (ssname skup_a ii)) (setq ii (1+ ii)) (setq oa_ctr 0 cont T ) (while cont (if (setq e_name (entnext e_name)) (progn (setq e_list (entget e_name)) (if (and (= (cdr (assoc 0 e_list)) "ATTRIB") (/= (logand (cdr (assoc 70 e_list)) 2) 2)) (progn (if old_al (setq old_al (cons e_list old_al)) (setq old_al (list e_list)) ) (setq oa_ctr (1+ oa_ctr)) (setq n_al (subst (cons 50 0.0) (assoc 50 e_list) e_list)) ;;; angle to 0.0 (entmod n_al) );;;progn (setq cont nil) );;;if );;;progn (setq cont nil) );;;if );;;while cont );;;progn );;;while < ii (command "regen") );;;defun rotatt
;;;;;; lisp END
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

If I may sugeest....setting up a loop that sifts through your selection set, and when it finds an attribute, sends the attribute to a small routine (which it sounds like you have) that will rotate it, then go back to the next item in the selection set looking for the next attribute.

Yes.
Me too ;)
Since I use various UCSs and views, I would find a routine like this useful in the event of having to change the orientation of completed annotation when changing my mind about the orientation of a particular drawing. I'd like to see what you come up with, and offer help if you need it. I'd sit down and do it myself but I'm up to my middle-aged next right now.
--


MichaelB
www.michaelbulatovich.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

That's NECK, not next.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.