Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Member
6 Posts
0 Kudos
Registered: ‎01-12-2012
Post 1 of 6
Accepted Solution

Window selection of attributes

254 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*
2,535 Posts
306 Kudos
Registered: ‎11-24-2009
Post 2 of 6

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
6 Posts
0 Kudos
Registered: ‎01-12-2012
Post 3 of 6

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*
2,535 Posts
306 Kudos
Registered: ‎11-24-2009
Post 4 of 6

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
6 Posts
0 Kudos
Registered: ‎01-12-2012
Post 5 of 6

Re: Window selection of attributes

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

That worked great! thank you!

*Expert Elite*
2,535 Posts
306 Kudos
Registered: ‎11-24-2009
Post 6 of 6

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!