Jump to content

Help...delete texts overlapping


tieptouch

Recommended Posts

I have many texts overlapping. I want to delete texts which are overlapping...Sorry, i'm very poor English.

I have an Ex in picture

Ex.jpg

Please help me! Thanks!!!

Link to comment
Share on other sites

It's simply an example. Maybe, you check them left to right.

 

If you think about it, it isn't just for this example though - it would apply to every overlap. And what if three text items are all overlapping each other? Now what do we delete? And for 'n' overlaps?

Link to comment
Share on other sites

Just a guess, but the numbers look like topographic data. Perhaps the user just wants some pieces of data deleted because they're redundant, and whatever's left over, regardless of what process performed the deleting, will have an even enough spread to be accurate as per the user's needs?

 

If it was me, I'd just lower the font size to the point where they didn't overlap and tell everyone else to pull out a magnifying glass if they can't read it.

 

EDIT: I suppose OVERKILL wouldn't work, because the text strings are different? I know you could set the fuzz to some really high number, but I don't know if you can tell it to work with just entity type and position, and disregard text strings.. hm..

Link to comment
Share on other sites

  • 7 months later...
If you think about it, it isn't just for this example though - it would apply to every overlap. And what if three text items are all overlapping each other? Now what do we delete? And for 'n' overlaps?

 

LM,

I am also interested in this lisp to delete overlapping text as describe by tieptouch. To understand the overlap text - basically there are a bunch of points picked up on the ground by the surveyors. Then it is transfer to the survey software which generate all the text to a specific height (e.g 1.6m on autocad). Especially for roads, there are drain, cutting on either sides. Thus there will be a lots of points being picked up as edge of road, guardrail, right side of drain, drain invert, left side of drain, bottom of cutting, top of cutting etc. The text (that will be the code, point number and the point elevation) - but we are looking at will be the text elevation. Since all the text elevation will be display and this causes the overlapping. Since we need to randomly delete the text elevation so that in the end it looks nice as shown by tieptouch. So which point to delete do not matter.

Hope this explain clearly. Thanks.

GP

Link to comment
Share on other sites

You may be use sth like that :

(defun c:FText (/ ent ent1 i lst newlayer ofset ss ss1 ss_tmp ans)
;|By Gia Bach 2010|;
(defun GetBound (ent ofs / ang elist ll lr tb tb1 tb2 ul ur)
(setq elist (entget ent)
ang (cdr (assoc 50 elist))
tb (textbox elist)
tb1 (car tb)
tb2 (cadr tb)
ll (polar (cdr (assoc 10 elist))
(+(angle '(0 0) tb1) ang) (DISTANCE '(0 0) tb1))
lr (polar ll ang (- (car tb2) (car tb1)))
ur (polar ll (+ ang (angle tb1 tb2)) (distance tb1 tb2))
ul (polar ll (+ ang (/ pi 2)) (- (cadr tb2) (cadr tb1))) )
(setq ang (angle ll lr) )
(setq ll (polar ll (- ang (* pi 0.75)) (sqrt (* (* ofs ofs) 2)))
lr (polar lr (- ang (/ pi 4)) (sqrt (* (* ofs ofs) 2)))
ur (polar ur (+ ang (/ pi 4)) (sqrt (* (* ofs ofs) 2)))
ul (polar ul (+ ang (* pi 0.75)) (sqrt (* (* ofs ofs) 2))) )
(list ll lr ur ul))

(command "_.undo" "be")
(setq ss (ssget (list (cons 0 "TEXT"))) ss1 (ssadd) )
(or *ofset (setq *ofset 0.5))
(initget 4)
(setq ofset (getreal (strcat "\nDistance Textbox offset: <" (rtos *ofset) ">")))
(if (= ofset nil) (setq ofset *ofset) (setq *ofset ofset))

(while (> (sslength ss) 0)
(setq ent (ssname ss 0)
lst (GetBound ent ofset) )
(ssdel ent ss)
(if (setq ss_tmp (ssget "cp" lst (list(cons 0 "TEXT"))))
(progn
(setq i -1)
(while (setq ent1 (ssname ss_tmp (setq i (1+ i))))
(if (not (equal ent ent1))
(progn
(ssadd ent1 ss1)
(if (ssmemb ent1 ss) (ssdel ent1 ss)) ))) ) ) )
(if (> (sslength ss1) 0)
(progn
(setq newlayer "Text_Filter")
(if (not (tblsearch "layer" newlayer))
(command "-layer" "n" newlayer "c" 2 newlayer "") )
(command "change" ss1 "" "p" "la" newlayer "") ) )
(setq ans (getstring "\n Do you want to Erase all of Dup Text ? [Y/N] <Y>"))
(if (or (= ans "") (not ans) (= (strcase ans) "Y")) (command ".erase" ss1 "") T)
(command "_.undo" "e")
(princ))

It will fil text that overlap follow distance you choice (offset from textbox), and change all found Text to layer Text_Filter, and let you decide erase or not. Text to keep is belong to sort of create

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