<?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: DWG modification without open in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680875#M1941</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your support, I'll search info on that.&lt;/P&gt;&lt;P&gt;Concerning the DGN, I guess that whenever you import the DGN inside new drawing, enities are the same as Autocad. DGN is MICROSTATION.&lt;/P&gt;&lt;P&gt;I'll keep you informed.&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jan 2023 17:59:30 GMT</pubDate>
    <dc:creator>grobnik</dc:creator>
    <dc:date>2023-01-15T17:59:30Z</dc:date>
    <item>
      <title>DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680244#M1939</link>
      <description>&lt;P&gt;Hi to everybody,&lt;/P&gt;&lt;P&gt;I have to modify a small part of each dwg inside a set of 200 DWG, see example "Sheet 100/XX" with "Sheet 100/&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;STRONG&gt;200&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;". Dwg have been imported from DGN so are not pure autocad and of course a question confirmation&amp;nbsp;&lt;SPAN&gt;of opening will be required before opening. Here the first question: how to trap the confirmation open request dialog box by VBA ? short way could be sendkeys function simulating "enter" as confirmation, but if there will be a better way by VBA could be useful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The second question is how to modify dwg without open it for editing ? I know that there is a way to have objects inside having access to drawing database and not directly to entity modification, but I'm not so expert with VBA.&lt;/P&gt;&lt;P&gt;Just for start I created a code, of course it's working but require a lot of time into operations... open -&amp;gt;confirmation -&amp;gt; search object and modify it -&amp;gt;save and close, repeat the same operation of 200 files...&lt;/P&gt;&lt;P&gt;Somebody could help me to find a short way ?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub MyMacro()
Dim NameOfFile As String
Dim MyPath As String
MyPath = "C:\Users\Utente\Downloads\DWG"
Open MyPath &amp;amp; "\" &amp;amp; "ListDwg.txt" For Input As 1
Do While Not EOF(1)
    Input #1, NameOfFile
    ThisDrawing.Application.Documents.Open MyPath &amp;amp; "\" &amp;amp; NameOfFile
    For Each Object In ThisDrawing.ModelSpace
        If TypeOf Object Is AcadText Or AcadMText Then
            If Right(Object.TextString, 3) = "/XX" Then
               MyString = "/200"
               MyString1 = Left(Object.TextString, Len(Object.TextString) - 3)
               Object.TextString = MyString1 &amp;amp; MyString
            End If
        End If
    Next
    ThisDrawing.Application.ZoomExtents
    ThisDrawing.Save
    ThisDrawing.Close
Loop
Close #1
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 08:10:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680244#M1939</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2023-01-15T08:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680862#M1940</link>
      <description>&lt;P&gt;I have not tried with DWG files that were converted from DGN files, but I think if you use ObjectDBX to open the drawing file in memory and update data/entities in the AxDbDocument, it is very likely you can avoid the said prompt/confirmation message pop up. Also, the batching process speed would be a lot faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have not used ObjectDBX, search this forum/the Internet for "ObjectDBX" and/or "AxDbDocument".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 17:41:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680862#M1940</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-01-15T17:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680875#M1941</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your support, I'll search info on that.&lt;/P&gt;&lt;P&gt;Concerning the DGN, I guess that whenever you import the DGN inside new drawing, enities are the same as Autocad. DGN is MICROSTATION.&lt;/P&gt;&lt;P&gt;I'll keep you informed.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 17:59:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11680875#M1941</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2023-01-15T17:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11681201#M1942</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/472256"&gt;@grobnik&lt;/a&gt;&amp;nbsp; If you're new to ObjectDBX, the thing to keep in mind is, although you have to reference a separate library, the object model is the same as what you already know in VBA. The only difference is that you work with the database in memory only. There is no Editor, so you can't do things that involve visual things, like create a selectionset or zoom or run SendCommand, as there is no command line to interpret it. But you can iterate paper space and model space and modify entities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 23:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11681201#M1942</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2023-01-15T23:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11683313#M1943</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/472256"&gt;@grobnik&lt;/a&gt;&amp;nbsp;One more thing. To iterate over system files use the VBScript FileSystemObject for working with folders and files. I also have a class that implements Windows system file dialogs for selecting files. I'll find that for you later if you are interested.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 19:15:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11683313#M1943</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2023-01-16T19:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11683335#M1944</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;thank you, I'm interested.... "&lt;STRONG&gt;&lt;EM&gt;I'll find that for you later if you are interested".&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm interested too a sample VBA code to have access to&amp;nbsp;&lt;SPAN&gt;ObjectDBX&amp;nbsp;and&amp;nbsp;AxDbDocument if you for sure could have a sample.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 19:23:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11683335#M1944</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2023-01-16T19:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11685935#M1945</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/472256"&gt;@grobnik&lt;/a&gt;&amp;nbsp; See &lt;A href="https://forums.autodesk.com/t5/vba/working-with-files-filedialogs-cls-and-browsefolder-bas/td-p/11685924/jump-to/first-unread-message" target="_blank" rel="noopener"&gt;this thread&lt;/A&gt; I just created for working with files. &lt;A href="https://forums.autodesk.com/t5/vba/updating-block-attributes/m-p/9542362" target="_blank" rel="noopener"&gt;This thread&lt;/A&gt; has a code sample for creating an ObjectDbx file object.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 17:20:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11685935#M1945</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2023-01-17T17:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: DWG modification without open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11696671#M1946</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your support I revised my code using&amp;nbsp;AxDbDocument functionality here below the code&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub CalFunction()
MyPath = "PATH"
Open MyPath &amp;amp; "list.txt" For Input As #1
Do While Not (EOF(1))
    Line Input #1, DwgName
    Call ListAttributes(MyPath &amp;amp; DwgName)
Loop
Close #1
End Sub

Public Sub ListAttributes(DwgName As String)
Dim DbxDoc As New AxDbDocument
DbxDoc.Open DwgName
Dim Entity As AcadEntity
For Each Entity In DbxDoc.ModelSpace
If TypeOf Entity Is AcadText Or TypeOf Entity Is AcadMText Then
    If Right(Entity.TextString, 4) = "/199" Then
        Set objTextEntity = Entity
        Debug.Print Entity.TextString
        Part1 = Left(objTextEntity.TextString, Len(objTextEntity.TextString) - 4)
        Part2 = "/200"
        objTextEntity.TextString = Part1 &amp;amp; Part2
        objTextEntity.Update
        Debug.Print objTextEntity.TextString
    End If
End If
Next
DbxDoc.SaveAs (DwgName)
End Sub&lt;/LI-CODE&gt;&lt;P&gt;it's working fine, I found a similar code on web for blocks managing and modified little bit.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jan 2023 10:53:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/dwg-modification-without-open/m-p/11696671#M1946</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2023-01-22T10:53:58Z</dc:date>
    </item>
  </channel>
</rss>

