Author Topic: Find Text in a Closed Drawing  (Read 11340 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Find Text in a Closed Drawing
« on: October 05, 2004, 02:20:06 PM »
I need to search a group of closed drawings for a text phrase. '30" ABOVE SLAB'
I don't necessarily need to change it, although it would be nice, but I do
need to identify which files it is in.
I don't have SuperFind and I believe it is no longer available.

Any ideas?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

M-dub

  • Guest
Find Text in a Closed Drawing
« Reply #1 on: October 05, 2004, 02:24:15 PM »
Docupoint Discovery
www.docupoint.com

It's not a simple little app, but it works very well.  We use it here for all of our drawing searching and viewing needs.  I think eloquintet is now using it as well.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Find Text in a Closed Drawing
« Reply #2 on: October 05, 2004, 02:40:01 PM »
Thanks I'll give it a try. :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

M-dub

  • Guest
Find Text in a Closed Drawing
« Reply #3 on: October 05, 2004, 02:43:59 PM »
I really do like the program.  THIS thread might be of some help if you decide to try it out...

ronjonp

  • Needs a day job
  • Posts: 7531
Find Text in a Closed Drawing
« Reply #4 on: October 05, 2004, 03:43:59 PM »
Also try http://www.knownsoft.com/. Works well and is very fast.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Find Text in a Closed Drawing
« Reply #5 on: October 05, 2004, 04:11:00 PM »
Try Superior Search found here
http://www.freewareseek.com/utils/filemanagers/S/0-3.html

Lot easyer to use.
Make sure you uncheck 'Skip Binary files' in the Advanced tab.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Find Text in a Closed Drawing
« Reply #6 on: October 05, 2004, 04:15:21 PM »
Quote from: ronjonp
Also try http://www.knownsoft.com/. Works well and is very fast.

Thanks I'll try it too.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
Find Text in a Closed Drawing
« Reply #7 on: October 05, 2004, 05:11:17 PM »
yeah sounds like a job for drawing searcher to me but hmmm you'd have to index all the drawing first how many drawings you need to search cab?

Davez

  • Guest
Find Text in a Closed Drawing
« Reply #8 on: October 05, 2004, 05:25:17 PM »
Those work great!!

Now if there was one that could modify the string of text that was searched for, that would be awesome.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Find Text in a Closed Drawing
« Reply #9 on: October 05, 2004, 06:11:47 PM »
ObjectDBX can scan drawings very quickly (without opening in them in the AutoCAD edit window) and it's free, though you'll have to roll yer own code (and have to run said code from a running instance of AutoCAD). I can scan drawings in the order of 10 to 100 per minute depending on size and what I'm scanning for.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

hendie

  • Guest
Find Text in a Closed Drawing
« Reply #10 on: October 05, 2004, 06:17:35 PM »
I have a copy of superfind somewhere.. if I can find it (heh), but I can't remember which version of Acad it stops working on...

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Find Text in a Closed Drawing
« Reply #11 on: October 06, 2004, 12:05:36 AM »
Quote from: CAB
I need to search a group of closed drawings for a text phrase. '30" ABOVE SLAB'
Any ideas?

I just placed a VBA project file "TextFind&Replace.dvb" to The Pond that allows you to select which directory to find drawings in, select which drawings to search, what search phrase and what to replace it with.

At this point it doesn't list which drawings it found the text and modified it, but it won't be too hard too add that feature. This is a work in progress and is based on code found at CADVault.com. In fact the entire browse for folders/files is all code from there.

If you'd like to try it out, I do suggest trying it on some 'sample' drawings first. Wildcrds for the search string are NOT supported, so be as complet in your string to search for as you must. For instance, just entering an "e" for the search and replacing it with "AB", will replace ALL e's in the drawing(s) with AB......

Feedback is welcome and will result in a more polished end product.

Oh, users of ACAD prior to 2004 must make sure that Object.DBX is available to use. If you aren't sure, run this little code snippet to be sure.
Code: [Select]

 (if (and (= (atoi (getvar "AcadVer")) 15)
      (not (vl-registry-read "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument\\CLSID"))
      )
(startapp "regsvr32.exe" (strcat "/s \"" (findfile "axdb15.dll") "\""))
)


Jeff

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Find Text in a Closed Drawing
« Reply #12 on: October 06, 2004, 07:37:40 AM »
Jeff
It stoped here
Dim bolMod As Boolean: bolMod = False

Compile Error
Invalid Outside Procedure
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Find Text in a Closed Drawing
« Reply #13 on: October 06, 2004, 10:33:32 AM »
Sorry CAB-
I had moved a line to the public area after testing that was supposed to be split up. If you edit the code to this it will work.
Code: [Select]

Dim strNew As String
Dim bolMod As Boolean 'EDIT this line


Private Sub UserForm_Initialize()
  'Set up
  Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument")
  Me.Caption = "Object DBX Batch Process"
  ListBox1.MultiSelect = fmMultiSelectMulti
  CommandButton1.Caption = "Browse for folder"
  CommandButton2.Caption = "Process Selection"
  CommandButton3.Caption = "Exit"
  bolMod = False 'ADD this line
End Sub

whdjr

  • Guest
Find Text in a Closed Drawing
« Reply #14 on: October 06, 2004, 03:09:42 PM »
CAB,
Here is an ObjectDBX method thru vlisp.  Try it and let me know how it does for you.
Code: [Select]
(vl-load-com)

(defun *error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)

(defun DLLRegister (dll)
  (startapp "regsvr32.exe" (strcat "/s \"" dll "\""))
)

(defun ProgID->ClassID (ProgID)
  (vl-registry-read
    (strcat "HKEY_CLASSES_ROOT\\" progid "\\CLSID")
  )
)

(defun DBX-Register (/)
  (if (/= (getvar "ACADVER") "15.0")
    (setq classname "ObjectDBX.AxDbDocument.16")
    (setq classname "ObjectDBX.AxDbDocument")
  )
  (cond
    ((ProgID->ClassID classname))
    ((and
       (setq server (findfile "AxDb15.dll"))
       (DLLRegister server)
       (ProgID->ClassID classname)
     )
     (ProgID->ClassID classname)
    )
    ((not (setq server (findfile "AxDb15.dll")))
     (alert
       "Error: Cannot locate ObjectDBX Type Library (AxDb15.dll)..."
     )
    )
    (T
     (DLLRegister "ObjectDBX.AxDbDocument")
     (or
       (ProgID->ClassID "ObjectDBX.AxDbDocument")
       (alert
"Error: Failed to register ObjectDBX ActiveX services..."
       )
     )
    )
  )
)

(defun findphrase (phrase document / count)
  (setq count 0)
  (vlax-for item (vla-get-modelspace document)
    (cond ((or (eq (vla-get-ObjectName item) "AcDbText")
      (eq (vla-get-ObjectName item) "AcDbMText")
  )
  (if (vl-string-search phrase (vla-get-textstring item))
    (setq count (1+ count))
  )
 )
 ((and (eq (vla-get-Objectname item) "AcDbBlockReference")
(eq (vla-get-hasattributes item) :vlax-true)
  )
  (foreach for-item (get_atts item)
    (if (vl-string-search phrase (vla-get-textstring for-item))
      (setq count (1+ count))
    )
  )
 )
    )
  )
  count
)

(defun get_atts (obj)
  (vlax-safearray->list
    (vlax-variant-value
      (vla-getattributes obj)
    )
  )
)

(defun c:tfar (/ file files str dbxdoc of lst wil classname)
  (setq file "")
  (while (setq file (getfiled "Select a file to replace text in" file "dwg" 128))
    (setq files (cons file files))
  )
  (cond ((not files) (princ "No files were selected."))
((not (setq str (getstring T "Enter search phrase?  ")))
(princ "\nSearch phrase is missing. ")
)
((not (DBX-Register)) (princ "Unable to load ObjectDBX."))
((not (setq dbxdoc (vla-GetInterfaceObject
    (vlax-get-acad-object)
    classname
  )
     )
)
(princ "Unable to load ObjectDBX.")
)
(T
(foreach f (reverse files)
  (setq of  (vl-catch-all-apply
      '(lambda ()
 (vlax-invoke-method dbxdoc 'open f)
)
    )
lst (if (vl-catch-all-error-p of)
      (list f "File was read only. ")
      (list f (findphrase str dbxdoc))
    )
wil (cons lst wil)
  )
)
)
  )
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (textscr)
  (mapcar '(lambda (x)
    (princ
      (strcat "\n"
      (car x)
      "\n"
      (cond ((eq (type (cadr x)) 'INT)
     (strcat (itoa (cadr x))
     " text entities matched your phrase."
     )
    )
    (T (cadr x))
      )
      )
    )
  )
 wil
  )
  (princ)
)