Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Member
jlscranton
Posts: 6
Registered: ‎01-12-2012
Message 1 of 6 (244 Views)
Accepted Solution

Window selection of attributes

244 Views, 5 Replies
10-16-2012 01:30 PM

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)
                              )
                           )
                        )
                     )
                  )
               )


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

 

*Expert Elite*
pbejse
Posts: 2,476
Registered: ‎11-24-2009
Message 2 of 6 (227 Views)

Re: Window selection of attributes

10-16-2012 07:15 PM 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

 

 

Active Member
jlscranton
Posts: 6
Registered: ‎01-12-2012
Message 3 of 6 (207 Views)

Re: Window selection of attributes

10-17-2012 05:28 AM 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.

*Expert Elite*
pbejse
Posts: 2,476
Registered: ‎11-24-2009
Message 4 of 6 (193 Views)

Re: Window selection of attributes

10-17-2012 08:42 AM 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

 

Active Member
jlscranton
Posts: 6
Registered: ‎01-12-2012
Message 5 of 6 (185 Views)

Re: Window selection of attributes

10-17-2012 09:49 AM in reply to: pbejse

That worked great! thank you!

*Expert Elite*
pbejse
Posts: 2,476
Registered: ‎11-24-2009
Message 6 of 6 (165 Views)

Re: Window selection of attributes

10-17-2012 08:20 PM in reply to: jlscranton

jlscranton wrote:

That worked great! thank you!


You are welcome jlscranton :smileyhappy:

 

Glad i could help

 

Cheers

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.