LISP request for advanced find from a list

LISP request for advanced find from a list

smallƑish
Advocate Advocate
2,951 Views
48 Replies
Message 1 of 49

LISP request for advanced find from a list

smallƑish
Advocate
Advocate

I have a list in a notepad file 

the same data included in a dwg file as a block attribute

Just needed to find the att with the effect of  the find command 

sample files attached  attached 

 

purpose  of the process is; (nothing to do with code, just for understanding )

1. make sure I didn't miss any att

2. location of the block is an in correct room 

0 Likes
2,952 Views
48 Replies
Replies (48)
Message 21 of 49

paullimapa
Mentor
Mentor

Once again glad this all worked out for you…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 22 of 49

smallƑish
Advocate
Advocate

One more issue raise, If any lines didn't match any blocks at DWG . Any option to get that data.

Because, with the current code I can verify everything. But if I missed any I can't find that. Any solution for that?

0 Likes
Message 23 of 49

paullimapa
Mentor
Mentor

I included in the code to print to the screen any lines not found. You can hit F2 key on the keyboard to scroll back to see the print out


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 24 of 49

smallƑish
Advocate
Advocate

Also if I escape the routine in between the process, is that possible to just print the last verified data on the cmd line. To resume the process by deleting till this line at notepad.

0 Likes
Message 25 of 49

smallƑish
Advocate
Advocate

Yes, I got answer to the next message also.

Thank you so much again and again.

It's hard to read users mind in advance. 

TON OF THANKS.

thank you so much for the complete perfect code.!!!!

0 Likes
Message 26 of 49

paullimapa
Mentor
Mentor

Sounds possible. Since I also included in the code to only select the blocks that are not on the verified layer, when run again with updated text file it’ll only select those blocks that have not been verified to compare with the attribute value list


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 27 of 49

paullimapa
Mentor
Mentor

I try to think ahead and sometimes it pays off…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 28 of 49

smallƑish
Advocate
Advocate

Yes I got it.

Ton of thanks again.!!!

0 Likes
Message 29 of 49

smallƑish
Advocate
Advocate

will that be possible selecting a mtext instead of a txt file to skip always selecting a file from PC?
simply selecting mtext as an object?
sample file attached.

0 Likes
Message 30 of 49

smallƑish
Advocate
Advocate

Looks like not possible.🥹

0 Likes
Message 31 of 49

paullimapa
Mentor
Mentor
Accepted solution

try this FnAtM.lsp which now offers MText selection instead of File selection


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 32 of 49

smallƑish
Advocate
Advocate

Thank you so much for the unlimited support. no words to express my gratitude.

0 Likes
Message 33 of 49

paullimapa
Mentor
Mentor

enjoy...and cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 34 of 49

paullimapa
Mentor
Mentor
Accepted solution

This revision FnAtvM.lsp should take care of this:

As we have a Mtext inside AutoCAD, modify the Mtext line colour.

Example;

Verified= green

Unverified = white

Unavailable= Red


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 35 of 49

smallƑish
Advocate
Advocate

Thank you so much for the updated version. this update makes the verification accurate and easier. again you are my lifesaver.!!!!!!

 

 

0 Likes
Message 36 of 49

paullimapa
Mentor
Mentor

enjoy & cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 37 of 49

smallƑish
Advocate
Advocate

Can Lisp ignore the special character mismatches?

Explanation sample drawing attached 

0 Likes
Message 38 of 49

paullimapa
Mentor
Mentor

not sure what you mean by ignore. I ran the routine and it ignored that value B5/DB-OP-P (with the "/") as it should since it didn't match with the value B5-DB-OP-P (with the "-") in the MTEXT

Now if you change the attval in the MTEXT to match B5/DB-OP-P (with the "/") then it'll find it.

So I'm not sure what the problem is:

paullimapa_0-1707770977452.png

paullimapa_2-1707771131450.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 39 of 49

smallƑish
Advocate
Advocate

I apologies for my confusing explanation, let me explain it clearly. In fact as per the message 1 the code is working perfectly, and with a lot of additional features which is very helpful. 

 

My request for an additional feature if possible, when I made the first drawing, I did not take care of the hyphen and special characters and it's not uniform as per the list in mtext. So my request is, is, the code can filter only the att's alphabet characters only. And ignore the special characters such as hyphen ,slash ,underscore etc. 

 

Basically the Mtext list will stay as it is. But the code will find the Att blocks regardless the special characters.

0 Likes
Message 40 of 49

paullimapa
Mentor
Mentor

I’m still a bit confused. Currently when I run the code it’ll select all blocks matching the given name on the given layer. Then it’ll grab the attributes matching the tag. Now this has to include attributes with odd characters. But it’ll only examine the attribute values listed on the MText list. Any values not shown on that list the code will ignore. Are you not getting such a result when you run the code?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes