Mistress Of The Dor Kness

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 27 July 2006

I know how to pick em: SelectSimilar routine

Posted on 09:03 by Unknown
EDIT 4/6/2010: SelectSimilar has been present in vertical products such as AutoCAD Architecture, however, due to the popularity of this post, I'd like to note that in AutoCAD 2010, this command was included in a package of extra tools offered to subscription users, and in 2011, it is present in vanilla AutoCAD as a native command.

In MAP3D 2006 there is a tool, accessed by most via the right-click menu, called SelectSimilar.

Once you’ve selected an object(s), you use this command to add all other similar entities throughout the drawing to your selection set. (I believe this tool is also available in Architectural Desktop [ADT])

I’ve heard quite a buzz on the newsgroups from MAP users who’ve upgraded to 2007 and are disappointed to see that this command is no longer available in it’s current form. That made me upset, so I’d been keeping my eyes open to see if anyone had come up with a routine which will accomplish the same thing… even going so far as asking people if they knew what sorts of things a command like that would look at and could they write something up.

Well… I finally found that special someone who could help me! Adam Wuellner, whose acquaintance I made via the Autodesk Newsgroups. He has kindly allowed me permission to post his code here:
(edit: Adam updated his code, and I am posting the new in here 7/28/06)



;;; Select Similar
;;; (based on a command found in a few versions of AutoCAD)
;;; written by Adam Wuellner
;;; all rights released

;--------> MAIN ROUTINE
(defun c:selsim  (/ ss1 i ent filter_list type-layer filter sstemp)
  (if (not (setq ss1 (cadr (ssgetfirst))))
    (setq ss1 (ssget)))
  (setq i           0
        filter_list '())
  (repeat (sslength ss1)
    (setq ent (entget (ssname ss1 i))
          i   (1+ i))
    (setq type-layer (list (assoc 0 ent) (assoc 8 ent)))
    (if (not (member type-layer filter_list))
      (setq filter_list (cons type-layer filter_list))))
  (foreach filter  filter_list
    (princ (strcat "selecting all " (cdar filter) " entities on layer " (cdadr filter) "...\n"))
    (setq sstemp (ssget "X" filter))
    (setq ss1    (ss:union ss1 sstemp)
          sstemp nil))
  (sssetfirst nil ss1)
  (princ))

;--------> UNION
(defun ss:union  (ss1 ss2 / ename ss-smaller ss-larger c)
  (cond ((and ss1 ss2)
         (setq c 0)
         (if (< (sslength ss1) (sslength ss2))
           (setq ss-smaller ss1
                 ss-larger ss2)
           (setq ss-larger ss1
                 ss-smaller ss2))
         (while (< c (sslength ss-smaller))
           (setq ename (ssname ss-smaller c)
                 c     (1+ c))
           (if (not (ssmemb ename ss-larger))
             (ssadd ename ss-larger)))
         ss-larger)
        (ss1 ss1)
        (ss2 ss2)
        (t nil)))


I have used this with success in MAP2005 as well as 2006.


If you’re not sure how to use this code, here are the steps to take:

Copy the above code, paste into notepad, save as SelectSimilar.lsp into an appropriate location on your hard drive.

When in AutoCAD (whatever flavor) type APPLOAD at the command line, navigate to the .lsp file you’ve just created (while accessing APPLOAD look for the little briefcase icon, where you can set to have the routine load on startup).

Once the routine is loaded: select an object, then type ‘selsim’ to run.

Look for my next post on how to add this command to your right-click menu in AutoCAD 2005 and below.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Applications, Autocad | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • MAP tool of the day - ADERSHEET (rubbersheet)
    from MAP3D 2006 help: ADERSHEET (Rubber Sheet command) Performs rubber sheeting on selected objects Rubber sheeting is a nonuniform adjustme...
  • The AUGI Board
    Well... since I've got two links to throw in here, I'll go ahead and talk about the augi board (~sticks tongue out at those who migh...
  • Bentley has BIM for FM? wot?
    Just decided to do a Google for Facilities Management BIM... and link #3 (~sigh~ and of course the first two show my pathetic self ranting a...
  • Connecting Moonlighters with Clients & a Few Handy Links
    Was cruising the classifieds forums over at the Autodesk Discussion Groups today and saw a note for this website: http://www.cadground.com/ ...
  • rant on iHop healthy menu
    Alright, this happened about two weeks ago, but, I'm going to use this public forum to rant because I was chatting about it with some fr...
  • Pre-AU 2006: Grand Canyon/Arrival/Registration
    After my last post, we had a lovely breakfast at our hotel, then reentered the park to take in the gorgeous scenery in the full (WARM) dayli...
  • Adding SelectSimilar to Right-Click menu in 2005 and below
    Adding SelectSimilar to the right-click menu in AutoCAD 2005: In a previous post , I showed some code from Adam W, and now we're going t...
  • Confirmation or Denial???
    Ok... starting around lunchtime on Monday, I began being inundated with phone calls. Friends from all over were calling to ask about how muc...
  • Uni: The end of the story
    I said at the end of my reflection article ' Was completing my bachelor's degree worth it? ', that my educational story wasn...
  • Cubicle Wars Funny
    Alright, this was the Friday Funny on FacilityBlog... I'm gasping for air over here... of course, I'm a nerd... you, faithful reader...

Categories

  • ACA
  • Alternative Energy
  • AMEP
  • Applications
  • AU2006
  • AU2007
  • AU2008
  • AUGI
  • AUGIWorld Magazine
  • Autocad
  • AutoCAD
  • Autodesk University
  • BIM
  • cad camp
  • CAD Camp
  • CAD/Design Salary Survey
  • CAFM
  • Database
  • Education
  • Engineering
  • Facilities Management
  • FMDesktop
  • funny
  • GatewayAUG
  • Hardware
  • HotNews
  • Job Opening
  • Media
  • off-topic
  • Revit
  • RMEP
  • St. Louis
  • Tutorials
  • Women In Design
  • Writing

Blog Archive

  • ►  2013 (27)
    • ►  November (3)
    • ►  September (1)
    • ►  July (1)
    • ►  June (16)
    • ►  May (2)
    • ►  April (1)
    • ►  March (2)
    • ►  February (1)
  • ►  2012 (14)
    • ►  December (2)
    • ►  November (4)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  May (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (22)
    • ►  November (3)
    • ►  October (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (1)
    • ►  May (7)
    • ►  April (1)
    • ►  March (2)
  • ►  2010 (16)
    • ►  December (2)
    • ►  November (5)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2009 (15)
    • ►  October (1)
    • ►  July (1)
    • ►  June (4)
    • ►  April (2)
    • ►  February (7)
  • ►  2008 (58)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (3)
    • ►  August (4)
    • ►  July (7)
    • ►  June (4)
    • ►  May (5)
    • ►  April (4)
    • ►  March (10)
    • ►  February (9)
    • ►  January (9)
  • ►  2007 (69)
    • ►  December (7)
    • ►  November (9)
    • ►  October (6)
    • ►  September (3)
    • ►  August (1)
    • ►  July (5)
    • ►  June (4)
    • ►  May (4)
    • ►  April (3)
    • ►  March (9)
    • ►  February (11)
    • ►  January (7)
  • ▼  2006 (121)
    • ►  December (7)
    • ►  November (8)
    • ►  October (10)
    • ►  September (13)
    • ►  August (16)
    • ▼  July (14)
      • AUGI posts June 2006 Wishlist Results
      • Adding SelectSimilar to Right-Click menu in 2005 a...
      • I know how to pick em: SelectSimilar routine
      • Autodesk MAP3D 2007 Service Pack 2 Released
      • Build your own via the web!
      • The coolest artist ever
      • Nifty Avatar Creation Site
      • Review: iPod to PC transfer
      • St. Louis Metro Storm Update
      • Never Rains But Pours
      • The role of FM in delivering the 2012 Olympic Game...
      • You might have noticed...
      • Very Valuable Variable: DRAGMODE
      • California is Beautiful
    • ►  June (14)
    • ►  May (6)
    • ►  April (7)
    • ►  March (7)
    • ►  February (14)
    • ►  January (5)
  • ►  2005 (68)
    • ►  December (9)
    • ►  November (10)
    • ►  October (7)
    • ►  September (4)
    • ►  August (5)
    • ►  July (11)
    • ►  June (9)
    • ►  May (4)
    • ►  April (9)
Powered by Blogger.

About Me

Unknown
View my complete profile