Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Find and replace command can't find textfield values

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
thomas_schlüssi
430 Views, 8 Replies

Find and replace command can't find textfield values

Hi guys!

 

So i came across a problem with the find and replace command when trying to find text which contain textfields in blockattributes.

 

I dont really want to "find and replace" i just want to quickly see how many blocks with the attribute value XXX are in my drawing. My blocks contain attributes which are having textfields in it to display certain values that get changed by other parameters. 

 

Is there any possibility to search after these values?

Maybe there is an "advanced" search LISP somewhere out there, flying around?

 

Thanks in advance.

 

8 REPLIES 8
Message 2 of 9
pendean
in reply to: thomas_schlüssi

What is your FIELDEVAL variable set to?
Message 3 of 9
thomas_schlüssi
in reply to: pendean

31
Message 4 of 9
Libbya
in reply to: thomas_schlüssi

I'm not sure if either would work for your specific requirements, but you might look into DATAEXTRACTION and QSELECT. 

Message 5 of 9

To my knowledge this functionality does not exist but AutoCAD desperately needs the ability of finding a field reference. 

Message 6 of 9
cadffm
in reply to: thomas_schlüssi

Hi,

count and dataextraction for count,

but for selection doesn't exist a ootb tool.

 

Find&replace won't work because it protects field, so they skipted the find-part too.

 

But you can use any other tool to select text text or in your case: Find blockreferences by attribut value.

 

One of a lot tools for example (untested)

https://forums.autodesk.com/t5/dynamic-blocks-forum/filter-by-attribute-with-field/td-p/10295652

 

 

 

Sebastian

EESignature

Message 7 of 9

@Libbya  DATAEXTRACTION and QSELECT both don't help in this case. It's just about selecting in model space. DATAEXTRACTION works for export and counting. QSELECT can't select by attribute value (if I'm right).

 

@cadffm  I tried the "BSEL" LISP, but this only works well with single-line attributes. With multi-line attributes (which i often use), it is very annoying to always write "\W0.9000;" before the value. Do you know if it is possible to change the LISP so that it automatically searches multi-line attributes? I need it so that I can simply enter my attribute value and the LISP automatically searches single-line and multi-line attributes and marks them.

Message 8 of 9
cadffm
in reply to: thomas_schlüssi

Hi,

 


@thomas_schlüssi wrote:

 

>>"it is very annoying to always write "\W0.9000;"

If you used internal Mtext/Matts formattings, like Witdth 0.9 in this sample, sure.

That's how internal mtext overrides are stored - as part of the content string.

But also if you have a Matts without internal formats or if you write the right content, it will not work with this code,

the code is not designed to work with Matts.

 

 

>>"Do you know if it is possible to change the LISP so that it automatically searches multi-line attributes?"

Yes, and for short(!) Matt values , it is pretty simple, change (assoc 1 atx) to (assoc 1 (reverse atx))

 

>>"I need it so that I can simply enter my attribute value "

Ignoring the internal formatting codes of Matts need some lines of code more.

But yes, it is possible to expand it that way.

Search for LM:UnFormat and add the (defun LM:UnFormat (str mtx / _replace rx) ....) code to this .lsp file.

 

change (cdr (assoc 1 atx)) or the tested (cdr(assoc 1 (reverse atx)))

to (LM:UnFormat (cdr (assoc 1 (reverse atx))) (if (assoc 101 atx) T nil))

 


>>"for short(!) Matt values..."

for more longer Values in Matts, this simple edit will fail.

To have a clean tool what works no matter the Matts value length is, you have to add some more lines again..

 

 

EDIT:

And if you have muliple lines in your Matt, use wildcard *

Search for *WHOIS* instead of WHOIS

 

Sebastian

EESignature

Message 9 of 9
thomas_schlüssi
in reply to: cadffm

Thank you very much.

The edited LISP and the use of wildcards does the job for me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta