Find and Replace results show texts that are not there

Find and Replace results show texts that are not there

MrMuscl3
Advocate Advocate
847 Views
14 Replies
Message 1 of 15

Find and Replace results show texts that are not there

MrMuscl3
Advocate
Advocate

Find and Replace is giving me odd results when I search text from drawing I currently am working with. I get 83 results with certain search word. Only 2 elements are selected when I select all 83. Find and Replace shows that all the results are Text elements. Double clicking one of these "ghost results" activates editing field for this single line text. These elements are only shown in drawing when the text field is activated for editing. These texts cannot be edited when selected for editing from Find and Replace results, only replacing is possible.

 

All layers are visible.

Tried ctrl + A and moving contents to another drawing. These results were still found.

Tried purge all. These results were still found.

 

How can I get rid of them?

AutoCAD 2025
0 Likes
Accepted solutions (1)
848 Views
14 Replies
Replies (14)
Message 2 of 15

cadffm
Consultant
Consultant

@MrMuscl3  schrieb:

How can I get rid of them?


First we have know what you really have and you are not able to exlain it,

so upload a sample DWG, tell us your search-Word

and we take a look an explain you what it is - hopefully we can explain it.

For usual we can 😉

 

 

Sebastian

0 Likes
Message 3 of 15

imadHabash
Mentor
Mentor

can you share those texts with us please as a CAD drawing file ( mention what word you're looking for) ?

 

 

Imad Habash

EESignature

0 Likes
Message 4 of 15

MrMuscl3
Advocate
Advocate

I have now attached sample. Drawing frames have been removed, so dont get confused with them.

 

Try searching with "AE11"

AutoCAD 2025
0 Likes
Message 5 of 15

cadffm
Consultant
Consultant

It sounds you havin text objects on OFF ot FREEZED  turned layers..

But it's guessing without your DWG.

 

Turn all layer ON:

Command: -LAYER<enter>

ON<enter>

*<enter>

THAW<enter>

*<enter>

<enter>

Try it again..

 

Sebastian

0 Likes
Message 6 of 15

cadffm
Consultant
Consultant

@MrMuscl3  schrieb:

I have now attached sample. Drawing frames have been removed, so dont get confused with them.

 

Try searching with "AE11"


Okay, there are HIDDEN objects (like you can hide objects by using the command ISOLATEOBJECTS).

There is no onboard feature to set these objects to visible, you need a third party function.

 

And you have 597 HIDDEN OBJECTS in your file!

Check my attachment, all RED(1) Objects

 

 

 

Sebastian

Message 7 of 15

MrMuscl3
Advocate
Advocate

I have AutoCAD 2018. Can you point any certain plugin or lisp to use to get this job done?

AutoCAD 2025
0 Likes
Message 8 of 15

cadffm
Consultant
Consultant

You can take a code like this:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/visible-invisible/m-p/1229351#M17172...

And change the line:
(if (setq ss (ssget "x" (list '(60 . 1) (cons 410 (getvar "ctab")))))
to:
(if (ssget "x" (list '(60 . 1) (cons 410 (getvar "ctab"))'(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>")))

Thats for objects in the current space only,
if you want to change invisible to visible in all layouts, use
(if (ssget "x" (list '(60 . 1) '(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>")))

 

 

Note, i added a filter for objects which are invisible because of the ISOLATEOBJECTS command,
because these objects you can unhide by the native command UNISOLATEOBJETCS.

Sebastian

Message 9 of 15

MrMuscl3
Advocate
Advocate

Thank you for your fast replies.

 

I currently have 8 of these files. Could it be possible to change the color or layer to specific one with this LISP, so I could use "Quick Select" function to quickly select all of these items and delete them? None of these are needed so they can all be deleted. Or even better, delete all these items by only running this LISP?

 

My experience with LISPs is very thin, so I must ask how this is executed? I mean, is there a command?

AutoCAD 2025
0 Likes
Message 10 of 15

cadffm
Consultant
Consultant

I have to edit my previous post:

 


@cadffm  schrieb:

You can take a code like this:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/visible-invisible/m-p/1229351#M17172...

And change the line:
(if (setq ss (ssget "x" (list '(60 . 1) (cons 410 (getvar "ctab")))))
to:
(if (setq ss (ssget "x" (list '(60 . 1) (cons 410 (getvar "ctab"))'(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>"))))

Thats for objects in the current space only,
if you want to change invisible to visible in all layouts, use
(if (setq ss (ssget "x" (list '(60 . 1) '(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>"))))

 

 

Note, i added a filter for objects which are invisible because of the ISOLATEOBJECTS command,
because these objects you can unhide by the native command UNISOLATEOBJETCS.


 

 

 

Sebastian

0 Likes
Message 11 of 15

MrMuscl3
Advocate
Advocate

I found out that this .lsp can be run with UNBLANK command.

 

Changing the line you mentioned to one you provided:

 

(if (setq ss (ssget "x" (list '(60 . 1) (cons 410 (getvar "ctab"))'(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>"))))

 

--> Ended up showing the content but every text has to manually selected by picking them with mouse pointer. Can the code be modified so they are really selected?

AutoCAD 2025
0 Likes
Message 12 of 15

cadffm
Consultant
Consultant

The PREVIOUS selectionset is keeping  these objects.

 

So you can easily move(move) copy(copy)  erase(erase) or hightlight (command SELECT while PICKADD is set to 2) the objects..

if not set to 2 - Command: PICKADD 2

Command: Select<enter>

previous<enter>

<enter>

 

 

Sebastian

0 Likes
Message 13 of 15

MrMuscl3
Advocate
Advocate

Ok. My logic says that you cannot select previous selection that was never there 😅

 

Here are the steps I made:

1. UNBLANK + enter -> I now see the elements, but properties is showing "No selection". I am also given "Select objects:" under my pointer.

2. SELECT + enter

3. PREVIOUS + enter + enter -> Elements are now visible and if selected, they are shown as text

4. SELECT + enter

5. PREVIOUS + enter + enter -> I have now selected all these elements that were not selected. And now they can be moved as well.

 

Am I doing this the right way since I have to double use select -> previous commands to get the items selected?

 

Care to explain how something that is not selected can be selected with previous? 😀

 

AutoCAD 2025
0 Likes
Message 14 of 15

cadffm
Consultant
Consultant
Accepted solution

1. This "unblank" tool from the other thread works this way:

 

Command UNBLANK

..all invisible objects on the current layout changes to visible

and then the unblank-command asks for object selection..

You can select all or just a part of all objects to keep still visible!,

these objects you are not select change to invisible back.

 

 

2. How to select never selected objects "previous"

  Thats wrong, the last object selection was "all invisible objects",

 this object selection was done by the unblank-.command (not by the user manually).

_

 

That's why you have to do it 2x

First time for the unblank-command

The second time for your next step (for example command:select previous)

 

_

 

Okay, i copy the code from the other thread because i am lazy and it isn't my job to post (better) programs.

(defun c:UnBlankQuick (/ ss ss2 cnt1 tmpEnt tmpData ocmd)
; UnBlank an object by selecting it in the current tab.
; Original UnBlank from https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/visible-invisible/m-p/1229351#M171724
(setq ocmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "_.undo" "_end")
(command "_.undo" "_group")
(if (setq ss (ssget "_X" (list '(60 . 1) (cons 410 (getvar "ctab"))'(-4 . "<not")'(-3 ("AEC_ISOLATEDOBJECTS_XDATA"))'(-4 . "not>"))))
(progn
(setq cnt1 0)
(while (setq tmpEnt (ssname ss cnt1))
(setq tmpData (entget tmpEnt))
(entmod (subst (cons 60 0) (assoc 60 tmpData) tmpData))
(redraw tmpEnt 3)
(setq cnt1 (1+ cnt1))
)
;;;(while (setq ss2 (ssget "_:S"))
;;;(while (setq tmpEnt (ssname ss2 0))
;;;(setq tmpData (entget tmpEnt))
;;;(entmod (subst (cons 60 1) (assoc 60 tmpData) tmpData))
;;;(ssdel tmpEnt ss)
;;;(ssdel tmpEnt ss2)
;;;)
;;;)
;;;(if (/= (sslength ss) 0)
;;;(progn
;;;(setq cnt1 0)
;;;(while (setq tmpEnt (ssname ss cnt1))
;;;(setq tmpData (entget tmpEnt))
;;;(if (assoc 60 tmpData)
;;;(entmod (subst (cons 60 1) (assoc 60 tmpData) tmpData))
;;;(entmod (append tmpData (list (cons 60 1))))
;;;)
;;;(setq cnt1 (1+ cnt1))
;;;)
;;;)
;;;)
)
)
(command "_.undo" "_end")
(setvar "cmdecho" ocmd)
(sssetfirst nil ss)
(princ)
)

Sebastian

Message 15 of 15

MrMuscl3
Advocate
Advocate

Really big thank to @cadffm for modifying the code to work properly and select directly the elements after running the command!

 

We often have images with these kind of elements and I have no idea where they come from. This will be great help to us and hopefully other users as well!

AutoCAD 2025
0 Likes