<?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: Regen or RegenAll each Entity in DWG C# or VB.NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827227#M9550</link>
    <description>&lt;P&gt;if you look in "Help", "regen" is viewport based (all objects in the current viewport). "regenall" regenerates the entire drawing and refreshes all viewports. for some reason, you are focused on entities.&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;has indicated, regenerating is a visual effect - a regen in a side database does not make sense. autocad regenerates when the file is opened in the editor (again - a visual effect only).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 22:10:20 GMT</pubDate>
    <dc:creator>fieldguy</dc:creator>
    <dc:date>2023-03-16T22:10:20Z</dc:date>
    <item>
      <title>Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825688#M9546</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;AutoCAD Mechanical 2023&lt;/P&gt;&lt;P&gt;API&amp;nbsp; &amp;nbsp;VB.NET or C# and VisualStudio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i try to regen the Entity in Drawing, but the Result ist not exactly good.&lt;/P&gt;&lt;P&gt;They are still some Entity, and they are not regetereted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actualy&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_0-1678967382560.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189512i866B7E4B5FA6FE72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_0-1678967382560.png" alt="florian_wenzel_0-1678967382560.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the Goal:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_0-1678968078681.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189516iB7CF8C076F92ED2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_0-1678968078681.png" alt="florian_wenzel_0-1678968078681.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_1-1678968103656.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189517i333933FE014B35BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_1-1678968103656.png" alt="florian_wenzel_1-1678968103656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my Code:&lt;/P&gt;&lt;P&gt;C#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("Regen_OpenDWG", CommandFlags.Session)]
public void OpenDWG()
{
    string strFileName = @"C:\InventorAPI\Example\2023.03.16\Test_A.dwg";
    string strFileNameSave = @"C:\InventorAPI\Example\2023.03.16\Test_B.dwg";

    DocumentCollection acDocMgr = Application.DocumentManager;

    using (Database acCurDB = new Database(false, true))
    {
        acCurDB.ReadDwgFile(strFileName, FileOpenMode.OpenForReadAndReadShare, true, "");

        // Regenerate each entity in the drawing
        Document acDoc = Application.DocumentManager.MdiActiveDocument;
        acDoc.SendStringToExecute("_REGENALL ", true, false, false);

        acCurDB.SaveAs(strFileNameSave, DwgVersion.AC1032);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB.NET:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    &amp;lt;CommandMethod("Regen_OpenDWG", CommandFlags.Session)&amp;gt;
    Public Sub OpenDWG()


        Dim strFileName As String = "C:\InventorAPI\Example\2023.03.16\Test_A.dwg"
        Dim strFileNameSave As String = "C:\InventorAPI\Example\2023.03.16\Test_B.dwg"

        Dim acDocMgr As DocumentCollection = Application.DocumentManager



        Using acCurDB As New Database(False, True)
            acCurDB.ReadDwgFile(strFileName, FileOpenMode.OpenForReadAndReadShare, True, "")

            ' Regenerate each entity in the drawing
            Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument

            acDoc.SendStringToExecute("_REGENALL ", True, False, False)
            acCurDB.SaveAs(strFileNameSave, DwgVersion.AC1032)

        End Using




    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any Suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 12:01:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825688#M9546</guid>
      <dc:creator>florian_wenzel</dc:creator>
      <dc:date>2023-03-16T12:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825733#M9547</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It seems there's some confusion here.&lt;/P&gt;
&lt;P&gt;On one hand, you use a side database to access to a dwg file (i.e. you open the "Test_A.dwg" file in memory) on the other hand, you call the Regen command in the active document (i.e. the active document from where you call "Regen_OpenDWG").&lt;/P&gt;
&lt;P&gt;What do you want to achieve?&lt;/P&gt;
&lt;P&gt;Regen the active document? if so, no need to create a new Database and read "Test_A.dwg".&lt;/P&gt;
&lt;P&gt;Regen the "Test_A.dwg" file? if so, you cannot access to the document of&amp;nbsp; a side Database and it is useless to regen a closed file because the document will automatically regen the next ime it is opened.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 12:10:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825733#M9547</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-16T12:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825781#M9548</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is possible to Regen all Entity from a Document in Memory using Side Database?&lt;/P&gt;&lt;P&gt;i was using few option, but with out result:&lt;/P&gt;&lt;P&gt;acCurDB.Regenmode = True&lt;/P&gt;&lt;P&gt;acDoc.Editor.Regen()&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 12:26:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11825781#M9548</guid>
      <dc:creator>florian_wenzel</dc:creator>
      <dc:date>2023-03-16T12:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827163#M9549</link>
      <description>&lt;P&gt;What makes you think you need to regenerate a dwg opened "in memory"?&lt;/P&gt;
&lt;P&gt;When using a "side database", the drawing is not opened in the editor (no access to the Document) so a regeneration is a non-sense.&lt;/P&gt;
&lt;P&gt;You should clearly explain what you want to achieve instead of how you think you could do it.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 21:42:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827163#M9549</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-16T21:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827227#M9550</link>
      <description>&lt;P&gt;if you look in "Help", "regen" is viewport based (all objects in the current viewport). "regenall" regenerates the entire drawing and refreshes all viewports. for some reason, you are focused on entities.&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;has indicated, regenerating is a visual effect - a regen in a side database does not make sense. autocad regenerates when the file is opened in the editor (again - a visual effect only).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 22:10:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827227#M9550</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2023-03-16T22:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827925#M9551</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i want to&amp;nbsp;&lt;SPAN&gt;achieve, that when i open next time the DWG Drawing, than each Curves will be regenereted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Actualy, the Super Goal is that, when i open next time the Drawing, than each Curves are regernerated and the View Zoom is fit to Object length.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But at most imported is, that the Curves are regenerated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, maybe my Idea is, that a Script, that will Automaticly make very close Zoom to Some Curves, than regenerated .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So i think, than after this, each Curves will be Regenerated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or to use the Methode:&amp;nbsp;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Entity.RecordGraphicsModified Method&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The reason is, that i need to send drawings to Laser Cut, and when they open the Drawings is not complet Ready.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will loop this&amp;nbsp;&amp;nbsp;through all Documents.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This dwg is only a Example&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 08:36:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11827925#M9551</guid>
      <dc:creator>florian_wenzel</dc:creator>
      <dc:date>2023-03-17T08:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828098#M9552</link>
      <description>&lt;P&gt;As explained upper, you cannot regen a side Database.&lt;/P&gt;
&lt;P&gt;You should post a drawing example and explain what's wrong with this drawing.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 09:42:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828098#M9552</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-17T09:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828151#M9553</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;so for example this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_2-1679047411228.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189954i56664E5D70E9FBDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_2-1679047411228.png" alt="florian_wenzel_2-1679047411228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_3-1679047423841.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189955i243CB4BB867502F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_3-1679047423841.png" alt="florian_wenzel_3-1679047423841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="florian_wenzel_4-1679047705691.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1189956i83E675C9EEBCFC9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="florian_wenzel_4-1679047705691.png" alt="florian_wenzel_4-1679047705691.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:08:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828151#M9553</guid>
      <dc:creator>florian_wenzel</dc:creator>
      <dc:date>2023-03-17T10:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828181#M9554</link>
      <description>&lt;P&gt;What you show in your screenshots is only the display in AutoCAD based on the Zoom value.&lt;/P&gt;
&lt;P&gt;This will not influence the use of the file with Laser Cut.&lt;/P&gt;
&lt;P&gt;A circle entity will always remain a circle (geometrically defined by a center, a radius and a normal) no matter how it is displayed.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:28:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828181#M9554</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-17T10:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828206#M9555</link>
      <description>&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;in this Case it was a Circle, but sometimes i make a Surface Unfold, and then the Holes is Not exactly a Circle, but a Spline. And then i look very bad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, other question, is possible to regenerated each Entity, only to Visual look.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Workflow with GUI is like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Zoom very close to a Circle&lt;/LI&gt;&lt;LI&gt;Command regen&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is Possible to do this with API, or maybe with other Steps or Methods&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 10:40:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828206#M9555</guid>
      <dc:creator>florian_wenzel</dc:creator>
      <dc:date>2023-03-17T10:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regen or RegenAll each Entity in DWG C# or VB.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828268#M9556</link>
      <description>&lt;P&gt;One more time, this only concerns the display in the AutoCAD editor.&lt;/P&gt;
&lt;P&gt;The Laser Cut won't take in account the curves display. It will read on the geometrical data in the DWG/DXF file.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 11:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen-or-regenall-each-entity-in-dwg-c-or-vb-net/m-p/11828268#M9556</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-03-17T11:05:01Z</dc:date>
    </item>
  </channel>
</rss>

