Delete overlapping text

Delete overlapping text

Anonymous
Not applicable
14,277 Views
19 Replies
Message 1 of 20

Delete overlapping text

Anonymous
Not applicable

Hi,

 

First post....so fingers crossed 🙂

 

I am using AutoCAD 2013.

 

My task is in 'cleaning-up' topographical survey drawings by deleting text which is overlapping and moving around the remaining so that it does not overlap any strings (lines) and is rotated to look aesthetically pleasing.

 

Is there a command that will enable me to remove all overlapping text? The moving and rotating I can do myself.

 

The text realating to the different features are differentiated by layer.

 

I recognise that in areas where text from one layer overlaps that from another layer then a decision needs to be made as to which takes precedence. It is probable that some form of weighting against each, is needed. A 'weighting table' perhaps?

 

Is there anything currently is existence that will do this?

 

Many thanks.

 

Rroger_D

0 Likes
14,278 Views
19 Replies
Replies (19)
Message 2 of 20

pendean
Community Legend
Community Legend
OVERKILL command perhaps?
0 Likes
Message 3 of 20

ВeekeeCZ
Consultant
Consultant

Maybe this routine would help you...
http://www.cadforum.cz/cadforum_en/overlapping-texts-find-and-fix-tip9464

 

Or this my routine. It put overlaping texts into special layer...

Message 4 of 20

Kent1Cooper
Consultant
Consultant

Welcome to these Forums!

 

By "overlapping" do you mean coinciding, including having the same content?  If so, the OVERKILL suggestion should work, though if you choose to have it ignore Layers so it will remove all but one, I'm not sure there's any way to give it direction on which one to keep.

 

An equivalent to OVERKILL could presumably be constructed for the purpose that would look for Text with the same characteristics, and include a "weighting table" in the form of a list of Layer names.  When two on different Layers coincide, the one whose Layer is later [or earlier if you prefer] in the list could be removed.

 

But if they have differing content, or are partially overlapping but not coinciding, then OVERKILL won't do it.  An image or sample drawing with before and after conditions would be helpful.  A routine would probably need to compare bounding boxes to look for overlap, but would any amount of overlap call for removing one Text object?  Would any of them ever be Mtext rather than Text?  [Mtext's bounding box can extend considerably beyond its visible content, so things that don't look like they overlap could have overlapping bounding boxes.]  The same weighting table could be applied.

 

Kent Cooper, AIA
0 Likes
Message 5 of 20

GrantsPirate
Mentor
Mentor

The command TSPACEINVADERS (yes it is a real autocad command) will create a selection set of text that is overlapping, then you just hit delete.


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

0 Likes
Message 6 of 20

Anonymous
Not applicable

Hi,

 

BIG thanks to all who have replied. Unfortunately, still not the solution that I am after.

 

OVERKILL, I believe looks for entirely coincident items. IE when they are on top of one another completely. Correct me if I am wrong.

 

TSPACEINVADERS, appears to highlight all overlapping text. The user still has to make the decision which to delete. This would be the same as manually searching through the drawing visually, as I see it.

 

TXTOVERLAP, appears to also just highlight the items. I can't seem to work out how to use this to delete the text or for it to do it automatically.

 

The solution as I see it and as Kent1cooper has suggested, is for Acad to automatically search the drawing for overlaps of the text boundaries. They are not multi-line text, so should be easier. The actual text entry is not relevant. Any overlap of the bounding box would count. As mentioned, I think that a weighting table would be required to provide the decision as to what is deleted in preference to another. Ideally, the associated '+' would also be deleted based upon the insert point of the text, but I guess that this is something to look at further later.

 

Is this something that anyone has written or can be written as a challenge perhaps?.. 🙂

 

I attach a 'before' and 'after' screen shot for reference.

 

Once again, many thanks in advance.

 

Rroger_D

0 Likes
Message 7 of 20

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

...

 

TXTOVERLAP, appears to also just highlight the items. I can't seem to work out how to use this to delete the text or for it to do it automatically.

 


As I sad before, it put overlapped objects into new layer "Text-Overlaping2Erase". If it does not work, let me know what it does and leaves... 

 

Try it again, because its best option you got so far. I wrote it with the same goal as you. But it does not do table weights or so... changing the alignment point is also not possible - for me unwanted ...

 

Or post here some sample, I'll try.

0 Likes
Message 8 of 20

GrantsPirate
Mentor
Mentor

Reading your first post, you said you want to remove overlapping text.  TSPACEINVADERS selects all overlapping text, then you just hit delete and they are all removed.  How does that not meet what you described?  Or did you not explain exactly what you meant by remove?


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

Message 9 of 20

Anonymous
Not applicable

Hi BeeKeeCZ,

 

Nope, still can't seem to get it to do anything. Not sure what I am doing wrong 😞

 

There is a layer created but it contained two symbols within it only and no text.

 

You say that you wrote it? Presumably it did what you wanted it to do? Do you think that it would have produced the results shown in my previous attachment doc if you had a copy of the dwg file? I could sent you a copy if you like. Is it possible to PM persons within the forum so that I could send it privately?

 

Ongoing thanks.

 

Rroger_D

0 Likes
Message 10 of 20

ВeekeeCZ
Consultant
Consultant

See image what it does. Red-ones are in special layer.

 

TextOverLaps.png

 

 

Message 11 of 20

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... 

The solution .... is for Acad to automatically search the drawing for overlaps of the text boundaries. They are not multi-line text, so should be easier. The actual text entry is not relevant. Any overlap of the bounding box would count. As mentioned, I think that a weighting table would be required to provide the decision as to what is deleted in preference to another.

....

I attach a 'before' and 'after' screen shot for reference.

....


It looks to me as though most of the Text objects removed in the "after" image were on the same Layer as objects they overlapped [same color, at least].  If on the same Layer, and the text content is not relevant, I'm having a hard time imagining what the weighting criteria could be.  Also, with the rotations, I can imagine situations in which bounding boxes [which are orthogonal] could overlap even if their text content does not.  There are ways to draw a box around Text that could be checked for intersections with boxes around other Text, but that's a lot of work for a routine to go through -- I guess it could be made to do so only as confirmation for pairings whose bounding boxes overlap.

Kent Cooper, AIA
0 Likes
Message 12 of 20

Kent1Cooper
Consultant
Consultant

@GrantsPirate wrote:

Reading your first post, you said you want to remove overlapping text.  TSPACEINVADERS selects all overlapping text, then you just hit delete and they are all removed.  How does that not meet what you described? ....


Doing it that way would remove all of them.  They want to keep some of them [see the images].

Kent Cooper, AIA
0 Likes
Message 13 of 20

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... Is it possible to PM persons within the forum so that I could send it privately?

...


Yes, you can do that [pick on the User name at the top left of a Post, and in the page that comes up, over on the right there's a place to "Send this User a ..."].  But just post it [preferably stripped down to just a relevant sub-set of things] here, and more people will be able to take a crack at it.

Kent Cooper, AIA
0 Likes
Message 14 of 20

Anonymous
Not applicable

Hi,

 

I think that from the example most are on the same layer. In normal circumstances there will be overlaps with text on many layers. My recent drawing had 18000+ text elements which all needed assessing / deleting / moving etc. Takes 2 days to complete and I am experienced. An automated process would trim this time by 75% I reckon.

 

If I remember correctly from my survey processing days, the package I used had a weighting table with value 999 for those which MUST not be deleted at all and then values 1 - 25 for all others depending upon their importance. The user would need to set the values although would always be constant with data received from the same source.

 

I assume that a routine would need to, per text element:

1) check if overlapping;

2) how many?

3) what layers of each?

4) check each's importnance (weight) against it's own, in turn;

5) consider all in order of importance;

6) start with lowest weight and delete against the next lowest weight;

7) is it's layer less weight than the next? Y - delete;

8) repeat until all test carried out on that piece of text;

9) move to next text element

10) repeat all of above.

 

I am not a programmer but I think, something like this...  🙂

 

Ongoing thank you's again.

 

Regards,

 

Rroger_D

0 Likes
Message 15 of 20

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

Hi BeeKeeCZ,

 

Nope, still can't seem to get it to do anything. Not sure what I am doing wrong 😞

 

There is a layer created but it contained two symbols within it only and no text.

 


My routine works with 2D text only (Z=0). 

I found another routine in my archive, not mine, so posting here. This works with non zero Z.

 

Message 16 of 20

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

Hi,

 

... which MUST not be deleted...


You must do this manually. These ones you want to keep move to special layer a lock it. Then isolate all the texts incl. that locked layer. Select all text and run TextOverLap. 

 

Good luck.

0 Likes
Message 17 of 20

Anonymous
Not applicable

Hi BeeKeeCZ,

 

 


@ВeekeeCZ wrote:

 

My routine works with 2D text only (Z=0). 

I found another routine in my archive, not mine, so posting here. This works with non zero Z.

 

The lsp offered seemes to detect overlapping text and hi-lights them but, deletes them all.
I spoke to a sofware engineer who has created a routine for a different package. His response was:
Basically, for each piece of text you need to find the tightest bounding polygon and see whether that intersects or occludes any other similar bounding polygon.  If so, you delete the less significant piece of text.  You repeat this until such time as no more intersections are found.  For a large data set, a brute force algorithm will be slow, so you need a reasonably efficient way of finding the overlapping polygons.

If anyone is up for the challenge........? 🙂

 

Cheers.

 

R_rogerD

0 Likes
Message 18 of 20

ВeekeeCZ
Consultant
Consultant

My routine treats all texts with the same signification. The routine takes the first outer and if with some other intersect, whose texts are erased (resp. put them on a special layer). And so on.
The routine can be adjusted so that the first texts were selected are from specific layer (most important texts), and if there are texts of less important layers intersect, they would have been erased. This could be repeated if it was specified layer less and less important texts. Then would follow the same procedure as described in the first paragraph with texts of the smallest importance.
You are able to specify the importance of texts (heights) using layers?

Message 19 of 20

piyush.parihar24
Advocate
Advocate

Hey,

 

Your routine is working just need to explode the text before selecting those.

 

 

Nice work..!!

0 Likes
Message 20 of 20

jswanson
Explorer
Explorer

I just ran on to your post. A friend of mine just sent me a CAD file with thousands of staked text, I was able to get most of them removed by a remove duplicated text command, but a few hundred were just slightly shifted in groups of three. Your suggestion worked to get rid of the rest. Thank you!