Jump to content

Routine/feature to select "similar" geometry?


Comatosis

Recommended Posts

Hello everyone,

 

It's possible I should take my question to another AutoCAD subforum first, but I'm guessing the answer over there will be no already, so I figured I should just bring it here and get it over with. 8)

 

Question: Is there a built-in feature in AutoCAD (or available LISP routine) that lets you select all instances of the same geometry based on your current selection?

 

Problem description: Our client sends us .dwg files that apparently are created in another piece of software and simply converted to DWG format for our use. The problem is that they always contain a bunch of objects that SHOULD be text, but instead are interpreted by AutoCAD as a combination of tiny lines/polylines/arcs, which we don't use at all and are a huge pain to remove while cleaning up their drawings to incorporate into ours.

 

Most of the objects are the same, however, aka they're different instances of the same combination of geometry. I was wondering if there was a way to select one such instance, and then tell AutoCAD to select every other instance of geometry that shares the same features (say, # of objects, lengths, relative coordinates, etc.).

 

We're running AutoCAD 2010, by the way. Thanks a bunch for the help.

 

(p.s. The "fonts" they use are pretty weird. Is it possible that simply downloading the font could resolve the issue? I haven't knowingly come across a case where a drawing includes fonts not recognized by AutoCAD, so I don't know how/if the program handles such a situation.)

Link to comment
Share on other sites

SELECTSIMILAR has been added to 2011 and up, you can get that for 2010 from the subscription advantage pack. If you are on subscription you can download it.

 

I first typed that it was in the Labs but that is not correct.

Edited by rkent
added words
Link to comment
Share on other sites

The description of SELECTSIMILAR on the subscription advantage pack page doesn't suggest it has any more functionality than QSELECT. Do you know for a fact that it can do the "select everything that looks like this" task I'm describing here? If so, I'll definitely start begging and pleading with the bosses to let me get a hold of this, heh.

 

Thanks.

Link to comment
Share on other sites

Nope, the SelectSimilar (and even my older SelSimilar on AUGI: http://forums.augi.com/showthread.php?66329-Selectsimilar-with-a-defined-area&p=827641#post827641) only select objects per their properties (i.e. colour, linetype, layer, style, etc.).

 

What you're after is something which would look at the relative control points of each object in comparison to each other. Then select all those groups of objects having similar relative points. That's a huge task, and I'm doubtful if such lisp has been attempted yet. Especially if such things as rotation needs to be accounted for. Are you certain this "exploded" text is not on a specific layer?

Link to comment
Share on other sites

Hi irneb,

Your SelectSimilar lisp is very useful! Can you add 2 buttons in DCL, one with Select All and anothe with Clear All? for options ...to clear them or to select them faster... Thanks!

Link to comment
Share on other sites

I'll look into doing that ... though it's a lot similar to the new built-in command. The only "benefit" of using mine over acad's own is that you can select the entities on which it applies, acad's always selects everything in the drawing and then filters on those.

Link to comment
Share on other sites

It sounds like they have been exploding their text when they convert to a DWG file. Have you considered contacting them to ask of they could pack it in? ;>

Link to comment
Share on other sites

Nope, the SelectSimilar (and even my older SelSimilar on AUGI: http://forums.augi.com/showthread.php?66329-Selectsimilar-with-a-defined-area&p=827641#post827641) only select objects per their properties (i.e. colour, linetype, layer, style, etc.).

 

What you're after is something which would look at the relative control points of each object in comparison to each other. Then select all those groups of objects having similar relative points. That's a huge task, and I'm doubtful if such lisp has been attempted yet. Especially if such things as rotation needs to be accounted for. Are you certain this "exploded" text is not on a specific layer?

 

Unfortunately, yes. The dwgs they send us are usually ~3 layers, and every layer has all kinds of stuff on it. The drawings are chock-full of blocks too--often times nested 3-deep--so I highly doubt that the issue is them exploding objects they shouldn't. And, the dwgs also have objects that AutoCAD does recognize as text which we can delete easily, but these other ones are a different font and yeah, it's always non-text text.

 

Obviously conceptualizing the problem and realizing it are completely different beasts, but in my head it didn't seem like it should be too tough a thing to do, even though it would take a looong time to process most likely. The way I do it now already involves QSELECTing all lines of a particular length (or smaller than length X), turning them a color that stands out big time, and then going through the sheet and erasing whichever objects fit the bill. I figured there should be a not-too-complicated way to normalize the current selection and narrow the choices down by elimination.

 

But eh, one can always dream. Once I have a bunch of time to spare I'll see if I can take a stab at it, heh.

Link to comment
Share on other sites

And this just occurred to me, what if I "defined" the objects in the LISP routine beforehand instead of going off the current selection? The vast majority of the objects in the dwgs are oriented the same way, after all, or rotated some multiple of 90 degrees at worst.

Link to comment
Share on other sites

Unfortunately there are so many other software that they could have used - it would crash CadTutor to describe them all. And even if everyone chipped in on that list, we'd probably still miss quite a lot. Could you ask your client what program they're using? Perhaps there's just a setting to make this less problematic.

 

I can imagine a lisp routine which would select all similar groups of linework. Hopefully the lines comprising any one character would be drawn in sequence, otherwise the complexity of such routine would become prohibitive. Could you send a sample of such drawing?

Link to comment
Share on other sites

I've updated my old SelSimilar command to include the dialog into the lisp itself - i.e. no more need to save into a support folder. Also remembers your choices of which properties to filter on (saves to registry so it even remembers between sessions). Added the All/None buttons into the dialog so you can more easily modify these.

 

The code can be downloaded from here: http://caddons.svn.sourceforge.net/viewvc/caddons/General/selsim.lsp?revision=64&view=markup

 

Unfortunately it's still only filtering on property values though, selecting groups of relatively similar objects is something which is going to take some time. :?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...