teknomatika Posted November 23, 2022 Posted November 23, 2022 Hi, I ask for your help for the following. I need to find a particular text string among thousands. Once found, it should be centrally visible in the window. I can't do that in the tool "Find and replace" because when I leave it, the location is lost. Another alternative would be to draw a circle around the string text with a diameter to be specified. Thanks! Quote
Steven P Posted November 23, 2022 Posted November 23, 2022 (edited) Depending on your LISP ability and how you want to search for the text: This link and offering from RonJon will find your text string (https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-text-lsp/td-p/9272343 (setq ss (ssget "X" (list '(0 . "*TEXT")(cons 1 str)(cons 410 (getvar "ctab"))))) str being the string to search for, This can have a wildcard * character in it something like (setq str "*my string*") Then you can use "Zoom" "Object" something like (command "ZOOM" "OB" (ssname ss 0) "") to zoom to it (this will zoom to the first instance of the text string that it finds if there are more than 1 in the drawing). You might want to do an additional zoom to zoom into the text depending how close you want to be to it Should be able to put that together? Edited November 23, 2022 by Steven P 2 Quote
mhupp Posted November 23, 2022 Posted November 23, 2022 if their are going to be multiple results use the following. (while (< (sslength SS) 0) (command "ZOOM" "OB" (ssname ss 0)) ;BricsCAD use OB for object O for out (command pause) ;allows user to see what was zoom to enter/right click to continue to next text (ssdel (ssname ss 0) ss) ) 3 Quote
Steven P Posted November 23, 2022 Posted November 23, 2022 7 minutes ago, mhupp said: ;BricsCAD use OB for object O for out Good point, I've edited mine above to this 2 Quote
teknomatika Posted November 23, 2022 Author Posted November 23, 2022 Steven P Thanks. The routine in the indicated link totally solves what I need. Thank you both for your attention. 1 Quote
BIGAL Posted November 24, 2022 Posted November 24, 2022 Sometimes using "Zoom C Pt scale" can be handy as well, most objects will have a dxf 10 that will provide a point to zoom to. 2 Quote
Recommended Posts
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.