Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Window selection of attributes

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
jlscranton
592 Views, 5 Replies

Window selection of attributes

I downloaded a lisp routine that will align block attributes. The problem is I can only select the attributes one at a time. I'd like to be able select multiple attributes using the selection window or a crossing window, but I haven't had much luck. If you use the AEATTSHOW command, it give you a prompt to "select using window" by pressing W. I'd like to have the same functionality for my Align attributes routine. Any help would be greatly appreciated. below is the portion of code I currently have to select attributes one at a time:

 

;* Select all attributes to align with the parent selected above and add the attribute entname and the block
               ;* entname to a list in format ( (AttrEntName BlkEntName) (AttrEntName BlkEntName) (AttrEntName BlkEntName) )
               ;*
               (while (/= TempAttr nil)
                  (setq
                     TempAttr (nentsel "\nSelect Attributes to align: ")
                  )
                  (if (/= TempAttr nil)
                     (progn
                        (setq
                           TempData (entget (car TempAttr))
                        )
                        (if (= (cdr (assoc 0 TempData)) "ATTRIB")  ;* Make sure entity selected was an attribute
                           ;*
                           ;* If this is Align or Fit justified text, skip this attribute since these are non-supported justifications
                           ;*
                           (if (or (= (GetTextJust TempData) "Align") (= (GetTextJust TempData) "Fit"))
                              (alert "Unsupported attribute justification.\nAlign and Fit justifications not supported")
                              ;else
                              (progn
                                 (setq
                                    BlkEntName (ssname (ssget (cadr TempAttr)) 0)
                                    ChildAttrList (cons (list (car TempAttr) BlkEntName) ChildAttrList)
                                 )
                                 ;*
                                 ;* Draw highlight box around selected attribute
                                 ;*
                                 (DrawBox TempData)
                              )
                           )
                        )
                     )
                  )
               )

5 REPLIES 5
Message 2 of 6
pbejse
in reply to: jlscranton

Hope you dont mind attaching the lisp program so we an have a  look see instead of recreating  the other sub functions shown on your post. e.i. GetTextJust / DrawBox

 

 

Message 3 of 6
jlscranton
in reply to: jlscranton

Here is the full LISP code for the attribute align. I didn't create it, so I don't want to take credit for it. It works great, I just wish I could select attributes a little faster as I use this quite often. Thanks.

Message 4 of 6
pbejse
in reply to: jlscranton


@jlscranton wrote:

Here is the full LISP code for the attribute align. I didn't create it, so I don't want to take credit for it. It works great, I just wish I could select attributes a little faster as I use this quite often. Thanks.


Try the attached modified code

 

HTH

 

Message 5 of 6
jlscranton
in reply to: pbejse

That worked great! thank you!

Message 6 of 6
pbejse
in reply to: jlscranton


@jlscranton wrote:

That worked great! thank you!


You are welcome jlscranton Smiley Happy

 

Glad i could help

 

Cheers

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost