<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297009#M70381</link>
    <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub MakeSelSet()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Dim oText &lt;BR /&gt;
As AcadText&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim vvar1 As &lt;BR /&gt;
Variant&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Utility.GetEntity oText, vvar1, &lt;BR /&gt;
"Select a 'TEXT': "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oText.TextString = &lt;BR /&gt;
"test1"&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"Jacob Dinardi" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:jacobd@nospam-californianatural.com"&amp;gt;jacobd@nospam-californianatural.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:C42AE01BCC30C32AE79C7CBE0A7A738A@in.WebX.maYIadrTaRb"&amp;gt;news:C42AE01BCC30C32AE79C7CBE0A7A738A@in.WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;There is not a whole lot to it, so I figured I'd &lt;BR /&gt;
  just post the code. You should be able to paste all this into a module and run &lt;BR /&gt;
  it, the program does expect there to be a layer named "B" - you should be able &lt;BR /&gt;
  to find and edit it. Fair warning this was an early attempt at acad vba, so it &lt;BR /&gt;
  could use some optimizing I'm sure. With that said, here ya go, and watch out &lt;BR /&gt;
  for word wrap...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Option Explicit&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;Dim oSS As AcadSelectionSet&lt;BR /&gt;Dim oEnt As &lt;BR /&gt;
  AcadEntity&lt;BR /&gt;Dim RemObj() As AcadEntity&lt;BR /&gt;Dim oLayer As AcadLayer&lt;BR /&gt;Dim &lt;BR /&gt;
  bLayers() As Boolean&lt;BR /&gt;Dim sFind As String&lt;BR /&gt;Dim i As Integer, j As &lt;BR /&gt;
  Integer&lt;BR /&gt;Dim fType(0) As Integer, fData(0) As Variant, Pt() As &lt;BR /&gt;
  Variant&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Public Sub Run_FindBOM()&lt;BR /&gt;&amp;nbsp; On Error &lt;BR /&gt;
  Resume Next&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Isolate layer B&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  IsolateLayers&lt;BR /&gt;&amp;nbsp; ActiveDocument.Layers("B").LayerOn = True&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp; 'Create the selection set&lt;BR /&gt;&amp;nbsp; MakeSelSet&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  'Get the letter to find&lt;BR /&gt;&amp;nbsp; sFind = &lt;BR /&gt;
  ActiveDocument.Utility.GetString(False, "Enter the mark to find: ")&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  'Remove all non-matches&lt;BR /&gt;&amp;nbsp; i = oSS.Count&lt;BR /&gt;&amp;nbsp; j = 0&lt;BR /&gt;&amp;nbsp; For &lt;BR /&gt;
  i = 0 To oSS.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oSS.Item(i).TextString &lt;BR /&gt;
  &amp;lt;&amp;gt; sFind Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim Preserve &lt;BR /&gt;
  RemObj(j)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set RemObj(j) = &lt;BR /&gt;
  oSS.Item(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  End If&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; 'Get rid of all the items that don't &lt;BR /&gt;
  match&lt;BR /&gt;&amp;nbsp; oSS.RemoveItems RemObj&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Report matches &lt;BR /&gt;
  found and zoom to each&lt;BR /&gt;&amp;nbsp; If oSS.Count Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
  MsgBox(oSS.Count &amp;amp; " matches found. Do you want to see them?", vbYesNo) = &lt;BR /&gt;
  vbYes Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Restore the previous layer &lt;BR /&gt;
  states&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To &lt;BR /&gt;
  ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = &lt;BR /&gt;
  bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  'Create the array of text insertion points&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ReDim Pt(oSS.Count)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = &lt;BR /&gt;
  0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oEnt In &lt;BR /&gt;
  oSS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pt(j) = &lt;BR /&gt;
  oEnt.InsertionPoint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + &lt;BR /&gt;
  1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ZoomCenter Pt(LBound(Pt)), (5 * &lt;BR /&gt;
  ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = LBound(Pt) + 1 To UBound(Pt) - &lt;BR /&gt;
  1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
  UCase(ActiveDocument.Utility.GetString(False, "View next (Y/N)? ")) &amp;lt;&amp;gt; &lt;BR /&gt;
  "Y" Then Exit For&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Application.ZoomCenter Pt(i), (5 * &lt;BR /&gt;
  ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'No &lt;BR /&gt;
  matches were found&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "No balloons matching """ &lt;BR /&gt;
  &amp;amp; sFind &amp;amp; """ were located."&lt;BR /&gt;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp; CleanUp&lt;BR /&gt;&amp;nbsp; Exit Sub&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;ERRTRAP:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 &lt;BR /&gt;
  To ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CleanUp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;End &lt;BR /&gt;
  Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub IsolateLayers()&lt;BR /&gt;&amp;nbsp; 'Store the &lt;BR /&gt;
  current layer state of each layer in the drawing&lt;BR /&gt;&amp;nbsp; For i = 0 To &lt;BR /&gt;
  ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim Preserve &lt;BR /&gt;
  bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bLayers(i) = &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = False&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;End &lt;BR /&gt;
Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub MakeSelSet()&lt;BR /&gt;&amp;nbsp; On Error &lt;BR /&gt;
  Resume Next&lt;BR /&gt;&amp;nbsp; ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Utility.Prompt "Select all balloons: "&lt;BR /&gt;&amp;nbsp; Set oSS = &lt;BR /&gt;
  ActiveDocument.SelectionSets.Add("SSFIND")&lt;BR /&gt;&amp;nbsp; fType(0) = 0: fData(0) = &lt;BR /&gt;
  "TEXT"&lt;BR /&gt;&amp;nbsp; oSS.SelectOnScreen fType, fData&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sub CleanUp()&lt;BR /&gt;&amp;nbsp; Set oSS = &lt;BR /&gt;
  Nothing&lt;BR /&gt;&amp;nbsp; Set oEnt = Nothing&lt;BR /&gt;&amp;nbsp; Set oLayer = Nothing&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  Erase bLayers&lt;BR /&gt;&amp;nbsp; Erase fType&lt;BR /&gt;&amp;nbsp; Erase fData&lt;BR /&gt;&amp;nbsp; Erase &lt;BR /&gt;
  fType&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
    &lt;A&gt;&lt;BR /&gt;
    href="news:f11182e.7@WebX.maYIadrTaRb"&amp;gt;news:f11182e.7@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;That &lt;BR /&gt;
    would be great Jacob. &lt;BR /&gt;
Thanks..................&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Tue, 24 Sep 2002 23:08:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-09-24T23:08:19Z</dc:date>
    <item>
      <title>Find and Zoom Using Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/296998#M70370</link>
      <description>I am trying to get AutoCAD to bring up a drawing or set of drawings and then use the Edit--&amp;gt;Find command to find a certain text string in the drawing and Zoom to it. Then I will be using a third party program to take a snapshot of the screen. This will be done multiple times to find multiple rooms within a drawing or set of drawings. I am looking at automating this using Visual Basic or Visual Basic For Applications.&lt;BR /&gt;
&lt;BR /&gt;
My question is on the "Find and Replace" dialog box, how can I put information in the textbox for the "Find text string:" prompt and then have the system press some buttons. I want to do this all from VB or VBA without any user intervention. Is this possible at all and if so any ideas/hints on how I can do it?</description>
      <pubDate>Tue, 24 Sep 2002 05:39:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/296998#M70370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T05:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Zoom Using Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/296999#M70371</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial"&gt;Create a SelectionSet &lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f11182e.-1@WebX.maYIadrTaRb"&amp;gt;news:f11182e.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
  am trying to get AutoCAD to bring up a drawing or set of drawings and then use &lt;BR /&gt;
  the Edit--&amp;gt;Find command to find a certain text string in the drawing and &lt;BR /&gt;
  Zoom to it. Then I will be using a third party program to take a snapshot of &lt;BR /&gt;
  the screen. This will be done multiple times to find multiple rooms within a &lt;BR /&gt;
  drawing or set of drawings. I am looking at automating this using Visual Basic &lt;BR /&gt;
  or Visual Basic For Applications. &lt;BR /&gt;
  &lt;P&gt;My question is on the "Find and Replace" dialog box, how can I put &lt;BR /&gt;
  information in the textbox for the "Find text string:" prompt and then have &lt;BR /&gt;
  the system press some buttons. I want to do this all from VB or VBA without &lt;BR /&gt;
  any user intervention. Is this possible at all and if so any ideas/hints on &lt;BR /&gt;
  how I can do it?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 06:11:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/296999#M70371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T06:11:10Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297000#M70372</link>
      <description>Could you give me any more details?</description>
      <pubDate>Tue, 24 Sep 2002 06:21:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297000#M70372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T06:21:19Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297001#M70373</link>
      <description>I do NOT see how this could work..................!?!?!?</description>
      <pubDate>Tue, 24 Sep 2002 08:20:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297001#M70373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T08:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Zoom Using Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297002#M70374</link>
      <description>If the text you're trying to find is in model or paper space and&lt;BR /&gt;
it is the entire contents of the text entity (as opposed to only&lt;BR /&gt;
a portion of it) you only need to use a selection set to locate it&lt;BR /&gt;
(using a filter with the entity type set to "TEXT", and dxf code 1&lt;BR /&gt;
for the text).&lt;BR /&gt;
&lt;BR /&gt;
If you're trying to do a case-insensitive search or the text you're&lt;BR /&gt;
trying to find is only a portion of the entire text entity's contents,&lt;BR /&gt;
or it is in MTEXT, then it becomes a bit more involved. A selection&lt;BR /&gt;
set filter with a wildcard can work for regular text, but for MTEXT&lt;BR /&gt;
there are formatting codes to deal with.&lt;BR /&gt;
&lt;BR /&gt;
A solution that can deal with any aforementioned case&lt;BR /&gt;
is the TextProcessor class in AcadX, which you can find at http://www.caddzone.com/acadx&lt;BR /&gt;
&lt;BR /&gt;
"rfrenter" &lt;RRAETH&gt; wrote in message news:f11182e.-1@WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I am trying to get AutoCAD to bring up a drawing or set of drawings and then use the Edit--&amp;gt;Find command to find a&lt;BR /&gt;
certain text string in the drawing and Zoom to it. Then I will be using a third party program to take a snapshot of the&lt;BR /&gt;
screen. This will be done multiple times to find multiple rooms within a drawing or set of drawings. I am looking at&lt;BR /&gt;
automating this using Visual Basic or Visual Basic For Applications.&lt;BR /&gt;
&amp;gt; My question is on the "Find and Replace" dialog box, how can I put information in the textbox for the "Find text&lt;BR /&gt;
string:" prompt and then have the system press some buttons. I want to do this all from VB or VBA without any user&lt;BR /&gt;
intervention. Is this possible at all and if so any ideas/hints on how I can do it?&lt;BR /&gt;
&amp;gt;&lt;/RRAETH&gt;</description>
      <pubDate>Tue, 24 Sep 2002 08:22:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297002#M70374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T08:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find and Zoom Using Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297003#M70375</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I have a small program to do this, if you'd like I &lt;BR /&gt;
can e-mail it to you and you can tweak it to suit your needs.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; Jacob Dinardi&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f11182e.-1@WebX.maYIadrTaRb"&amp;gt;news:f11182e.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
  am trying to get AutoCAD to bring up a drawing or set of drawings and then use &lt;BR /&gt;
  the Edit--&amp;gt;Find command to find a certain text string in the drawing and &lt;BR /&gt;
  Zoom to it. Then I will be using a third party program to take a snapshot of &lt;BR /&gt;
  the screen. This will be done multiple times to find multiple rooms within a &lt;BR /&gt;
  drawing or set of drawings. I am looking at automating this using Visual Basic &lt;BR /&gt;
  or Visual Basic For Applications. &lt;BR /&gt;
  &lt;P&gt;My question is on the "Find and Replace" dialog box, how can I put &lt;BR /&gt;
  information in the textbox for the "Find text string:" prompt and then have &lt;BR /&gt;
  the system press some buttons. I want to do this all from VB or VBA without &lt;BR /&gt;
  any user intervention. Is this possible at all and if so any ideas/hints on &lt;BR /&gt;
  how I can do it?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 08:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297003#M70375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T08:43:16Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297004#M70376</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;just run the code in vba put text to find in &lt;BR /&gt;
textbox1 &lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;put text to replase in txbox2 an run &lt;BR /&gt;
it&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f11182e.2@WebX.maYIadrTaRb"&amp;gt;news:f11182e.2@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
  do NOT see how this could &lt;BR /&gt;
work..................!?!?!?&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 09:25:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297004#M70376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T09:25:07Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297005#M70377</link>
      <description>&lt;DIV&gt;post the code&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"Jacob Dinardi" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:jacobd@nospam-californianatural.com"&amp;gt;jacobd@nospam-californianatural.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:F255ADA471150CC8E9F752B43EFEEF78@in.WebX.maYIadrTaRb"&amp;gt;news:F255ADA471150CC8E9F752B43EFEEF78@in.WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I have a small program to do this, if you'd like &lt;BR /&gt;
  I can e-mail it to you and you can tweak it to suit your needs.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp; Jacob Dinardi&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
    &lt;A&gt;&lt;BR /&gt;
    href="news:f11182e.-1@WebX.maYIadrTaRb"&amp;gt;news:f11182e.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
    am trying to get AutoCAD to bring up a drawing or set of drawings and then &lt;BR /&gt;
    use the Edit--&amp;gt;Find command to find a certain text string in the drawing &lt;BR /&gt;
    and Zoom to it. Then I will be using a third party program to take a &lt;BR /&gt;
    snapshot of the screen. This will be done multiple times to find multiple &lt;BR /&gt;
    rooms within a drawing or set of drawings. I am looking at automating this &lt;BR /&gt;
    using Visual Basic or Visual Basic For Applications. &lt;BR /&gt;
    &lt;P&gt;My question is on the "Find and Replace" dialog box, how can I put &lt;BR /&gt;
    information in the textbox for the "Find text string:" prompt and then have &lt;BR /&gt;
    the system press some buttons. I want to do this all from VB or VBA without &lt;BR /&gt;
    any user intervention. Is this possible at all and if so any ideas/hints on &lt;BR /&gt;
    how I can do it?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 09:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297005#M70377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T09:53:25Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297006#M70378</link>
      <description>That would be great Jacob.  Thanks..................</description>
      <pubDate>Tue, 24 Sep 2002 10:02:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297006#M70378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T10:02:39Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297007#M70379</link>
      <description>&lt;DIV&gt;&amp;nbsp;okay post the code&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;LHGO&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f11182e.7@WebX.maYIadrTaRb"&amp;gt;news:f11182e.7@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;That &lt;BR /&gt;
  would be great Jacob. Thanks..................&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 11:46:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297007#M70379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T11:46:02Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297008#M70380</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;There is not a whole lot to it, so I figured I'd &lt;BR /&gt;
just post the code. You should be able to paste all this into a module and run &lt;BR /&gt;
it, the program does expect there to be a layer named "B" - you should be able &lt;BR /&gt;
to find and edit it. Fair warning this was an early attempt at acad vba, so it &lt;BR /&gt;
could use some optimizing I'm sure. With that said, here ya go, and watch out &lt;BR /&gt;
for word wrap...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Option Explicit&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;Dim oSS As AcadSelectionSet&lt;BR /&gt;Dim oEnt As &lt;BR /&gt;
AcadEntity&lt;BR /&gt;Dim RemObj() As AcadEntity&lt;BR /&gt;Dim oLayer As AcadLayer&lt;BR /&gt;Dim &lt;BR /&gt;
bLayers() As Boolean&lt;BR /&gt;Dim sFind As String&lt;BR /&gt;Dim i As Integer, j As &lt;BR /&gt;
Integer&lt;BR /&gt;Dim fType(0) As Integer, fData(0) As Variant, Pt() As &lt;BR /&gt;
Variant&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Public Sub Run_FindBOM()&lt;BR /&gt;&amp;nbsp; On Error Resume &lt;BR /&gt;
Next&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Isolate layer B&lt;BR /&gt;&amp;nbsp; IsolateLayers&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.Layers("B").LayerOn = True&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Create the &lt;BR /&gt;
selection set&lt;BR /&gt;&amp;nbsp; MakeSelSet&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Get the letter to &lt;BR /&gt;
find&lt;BR /&gt;&amp;nbsp; sFind = ActiveDocument.Utility.GetString(False, "Enter the mark &lt;BR /&gt;
to find: ")&lt;BR /&gt;&amp;nbsp; 'Remove all non-matches&lt;BR /&gt;&amp;nbsp; i = oSS.Count&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
j = 0&lt;BR /&gt;&amp;nbsp; For i = 0 To oSS.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
oSS.Item(i).TextString &amp;lt;&amp;gt; sFind Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ReDim Preserve RemObj(j)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set RemObj(j) = &lt;BR /&gt;
oSS.Item(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
End If&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; 'Get rid of all the items that don't &lt;BR /&gt;
match&lt;BR /&gt;&amp;nbsp; oSS.RemoveItems RemObj&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Report matches &lt;BR /&gt;
found and zoom to each&lt;BR /&gt;&amp;nbsp; If oSS.Count Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
MsgBox(oSS.Count &amp;amp; " matches found. Do you want to see them?", vbYesNo) = &lt;BR /&gt;
vbYes Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Restore the previous layer &lt;BR /&gt;
states&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To &lt;BR /&gt;
ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.Layers(i).LayerOn = bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
'Create the array of text insertion points&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ReDim Pt(oSS.Count)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = &lt;BR /&gt;
0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oEnt In &lt;BR /&gt;
oSS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pt(j) = &lt;BR /&gt;
oEnt.InsertionPoint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + &lt;BR /&gt;
1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ZoomCenter Pt(LBound(Pt)), (5 * &lt;BR /&gt;
ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = LBound(Pt) + 1 To UBound(Pt) - &lt;BR /&gt;
1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
UCase(ActiveDocument.Utility.GetString(False, "View next (Y/N)? ")) &amp;lt;&amp;gt; "Y" &lt;BR /&gt;
Then Exit For&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Application.ZoomCenter Pt(i), (5 * &lt;BR /&gt;
ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'No &lt;BR /&gt;
matches were found&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "No balloons matching """ &amp;amp; &lt;BR /&gt;
sFind &amp;amp; """ were located."&lt;BR /&gt;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
CleanUp&lt;BR /&gt;&amp;nbsp; Exit Sub&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;ERRTRAP:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To &lt;BR /&gt;
ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.Layers(i).LayerOn = bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CleanUp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;End &lt;BR /&gt;
Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub IsolateLayers()&lt;BR /&gt;&amp;nbsp; 'Store the &lt;BR /&gt;
current layer state of each layer in the drawing&lt;BR /&gt;&amp;nbsp; For i = 0 To &lt;BR /&gt;
ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim Preserve &lt;BR /&gt;
bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bLayers(i) = &lt;BR /&gt;
ActiveDocument.Layers(i).LayerOn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.Layers(i).LayerOn = False&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub MakeSelSet()&lt;BR /&gt;&amp;nbsp; On Error Resume &lt;BR /&gt;
Next&lt;BR /&gt;&amp;nbsp; ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
ActiveDocument.Utility.Prompt "Select all balloons: "&lt;BR /&gt;&amp;nbsp; Set oSS = &lt;BR /&gt;
ActiveDocument.SelectionSets.Add("SSFIND")&lt;BR /&gt;&amp;nbsp; fType(0) = 0: fData(0) = &lt;BR /&gt;
"TEXT"&lt;BR /&gt;&amp;nbsp; oSS.SelectOnScreen fType, fData&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sub CleanUp()&lt;BR /&gt;&amp;nbsp; Set oSS = Nothing&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
Set oEnt = Nothing&lt;BR /&gt;&amp;nbsp; Set oLayer = Nothing&lt;BR /&gt;&amp;nbsp; Erase &lt;BR /&gt;
bLayers&lt;BR /&gt;&amp;nbsp; Erase fType&lt;BR /&gt;&amp;nbsp; Erase fData&lt;BR /&gt;&amp;nbsp; Erase fType&lt;BR /&gt;End &lt;BR /&gt;
Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:f11182e.7@WebX.maYIadrTaRb"&amp;gt;news:f11182e.7@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;That &lt;BR /&gt;
  would be great Jacob. Thanks..................&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 12:21:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297008#M70380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T12:21:28Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297009#M70381</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub MakeSelSet()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Dim oText &lt;BR /&gt;
As AcadText&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim vvar1 As &lt;BR /&gt;
Variant&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActiveDocument.Utility.GetEntity oText, vvar1, &lt;BR /&gt;
"Select a 'TEXT': "&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oText.TextString = &lt;BR /&gt;
"test1"&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"Jacob Dinardi" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:jacobd@nospam-californianatural.com"&amp;gt;jacobd@nospam-californianatural.com&lt;/A&gt;&amp;gt; &lt;BR /&gt;
  wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:C42AE01BCC30C32AE79C7CBE0A7A738A@in.WebX.maYIadrTaRb"&amp;gt;news:C42AE01BCC30C32AE79C7CBE0A7A738A@in.WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;There is not a whole lot to it, so I figured I'd &lt;BR /&gt;
  just post the code. You should be able to paste all this into a module and run &lt;BR /&gt;
  it, the program does expect there to be a layer named "B" - you should be able &lt;BR /&gt;
  to find and edit it. Fair warning this was an early attempt at acad vba, so it &lt;BR /&gt;
  could use some optimizing I'm sure. With that said, here ya go, and watch out &lt;BR /&gt;
  for word wrap...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Option Explicit&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;BR /&gt;Dim oSS As AcadSelectionSet&lt;BR /&gt;Dim oEnt As &lt;BR /&gt;
  AcadEntity&lt;BR /&gt;Dim RemObj() As AcadEntity&lt;BR /&gt;Dim oLayer As AcadLayer&lt;BR /&gt;Dim &lt;BR /&gt;
  bLayers() As Boolean&lt;BR /&gt;Dim sFind As String&lt;BR /&gt;Dim i As Integer, j As &lt;BR /&gt;
  Integer&lt;BR /&gt;Dim fType(0) As Integer, fData(0) As Variant, Pt() As &lt;BR /&gt;
  Variant&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Public Sub Run_FindBOM()&lt;BR /&gt;&amp;nbsp; On Error &lt;BR /&gt;
  Resume Next&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Isolate layer B&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  IsolateLayers&lt;BR /&gt;&amp;nbsp; ActiveDocument.Layers("B").LayerOn = True&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp; 'Create the selection set&lt;BR /&gt;&amp;nbsp; MakeSelSet&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  'Get the letter to find&lt;BR /&gt;&amp;nbsp; sFind = &lt;BR /&gt;
  ActiveDocument.Utility.GetString(False, "Enter the mark to find: ")&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  'Remove all non-matches&lt;BR /&gt;&amp;nbsp; i = oSS.Count&lt;BR /&gt;&amp;nbsp; j = 0&lt;BR /&gt;&amp;nbsp; For &lt;BR /&gt;
  i = 0 To oSS.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oSS.Item(i).TextString &lt;BR /&gt;
  &amp;lt;&amp;gt; sFind Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim Preserve &lt;BR /&gt;
  RemObj(j)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set RemObj(j) = &lt;BR /&gt;
  oSS.Item(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  End If&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp; 'Get rid of all the items that don't &lt;BR /&gt;
  match&lt;BR /&gt;&amp;nbsp; oSS.RemoveItems RemObj&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; 'Report matches &lt;BR /&gt;
  found and zoom to each&lt;BR /&gt;&amp;nbsp; If oSS.Count Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
  MsgBox(oSS.Count &amp;amp; " matches found. Do you want to see them?", vbYesNo) = &lt;BR /&gt;
  vbYes Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Restore the previous layer &lt;BR /&gt;
  states&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 To &lt;BR /&gt;
  ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = &lt;BR /&gt;
  bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  'Create the array of text insertion points&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ReDim Pt(oSS.Count)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = &lt;BR /&gt;
  0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each oEnt In &lt;BR /&gt;
  oSS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pt(j) = &lt;BR /&gt;
  oEnt.InsertionPoint&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + &lt;BR /&gt;
  1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ZoomCenter Pt(LBound(Pt)), (5 * &lt;BR /&gt;
  ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = LBound(Pt) + 1 To UBound(Pt) - &lt;BR /&gt;
  1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If &lt;BR /&gt;
  UCase(ActiveDocument.Utility.GetString(False, "View next (Y/N)? ")) &amp;lt;&amp;gt; &lt;BR /&gt;
  "Y" Then Exit For&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Application.ZoomCenter Pt(i), (5 * &lt;BR /&gt;
  ActiveDocument.GetVariable("DIMSCALE"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'No &lt;BR /&gt;
  matches were found&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "No balloons matching """ &lt;BR /&gt;
  &amp;amp; sFind &amp;amp; """ were located."&lt;BR /&gt;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp; CleanUp&lt;BR /&gt;&amp;nbsp; Exit Sub&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  &lt;BR /&gt;ERRTRAP:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 &lt;BR /&gt;
  To ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  Next&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CleanUp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;End &lt;BR /&gt;
  Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub IsolateLayers()&lt;BR /&gt;&amp;nbsp; 'Store the &lt;BR /&gt;
  current layer state of each layer in the drawing&lt;BR /&gt;&amp;nbsp; For i = 0 To &lt;BR /&gt;
  ActiveDocument.Layers.Count - 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReDim Preserve &lt;BR /&gt;
  bLayers(i)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bLayers(i) = &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Layers(i).LayerOn = False&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;End &lt;BR /&gt;
Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Private Sub MakeSelSet()&lt;BR /&gt;&amp;nbsp; On Error &lt;BR /&gt;
  Resume Next&lt;BR /&gt;&amp;nbsp; ActiveDocument.SelectionSets("SSFIND").Delete&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  ActiveDocument.Utility.Prompt "Select all balloons: "&lt;BR /&gt;&amp;nbsp; Set oSS = &lt;BR /&gt;
  ActiveDocument.SelectionSets.Add("SSFIND")&lt;BR /&gt;&amp;nbsp; fType(0) = 0: fData(0) = &lt;BR /&gt;
  "TEXT"&lt;BR /&gt;&amp;nbsp; oSS.SelectOnScreen fType, fData&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Sub CleanUp()&lt;BR /&gt;&amp;nbsp; Set oSS = &lt;BR /&gt;
  Nothing&lt;BR /&gt;&amp;nbsp; Set oEnt = Nothing&lt;BR /&gt;&amp;nbsp; Set oLayer = Nothing&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;
  Erase bLayers&lt;BR /&gt;&amp;nbsp; Erase fType&lt;BR /&gt;&amp;nbsp; Erase fData&lt;BR /&gt;&amp;nbsp; Erase &lt;BR /&gt;
  fType&lt;BR /&gt;End Sub&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
  &lt;BLOCKQUOTE&gt;&lt;BR /&gt;
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
    &lt;DIV&gt;"rfrenter" &amp;lt;&lt;A&gt;&lt;BR /&gt;
    href="mailto:rraeth@korbel.net"&amp;gt;rraeth@korbel.net&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
    &lt;A&gt;&lt;BR /&gt;
    href="news:f11182e.7@WebX.maYIadrTaRb"&amp;gt;news:f11182e.7@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;That &lt;BR /&gt;
    would be great Jacob. &lt;BR /&gt;
Thanks..................&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Sep 2002 23:08:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/find-and-zoom-using-visual-basic/m-p/297009#M70381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-09-24T23:08:19Z</dc:date>
    </item>
  </channel>
</rss>

