<?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 How to handle the EndSave event (.net vb)? in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/how-to-handle-the-endsave-event-net-vb/m-p/8252214#M167162</link>
    <description>&lt;P&gt;How to handle the EndSave event (.net vb)?&lt;/P&gt;&lt;P&gt;I don't understand this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-ActiveX-Reference/files/GUID-D72C232D-82D9-4C63-9808-9E8CFE514B36-htm.html" target="_blank"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-3750.htm,topicNumber=d0e5186&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also I don't get it if it is a DocumentEvent or DocumentCollectionEvent.&lt;/P&gt;&lt;P&gt;Like what is the correct name of the event? I can't find it. And what name should the procedure have?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for an AutoCAD plugin which already registers when the user closes AutoCAD. I want it to register the EndSave as well, but I don't know how to do it. I've also attached an image to the code in visual studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;Imports Excel = Microsoft.Office.Interop.Excel&lt;BR /&gt;Imports System.IO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Class Class1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;CommandMethod("AddAppEvent")&amp;gt;&lt;BR /&gt;Public Sub AddAppEvent()&lt;BR /&gt;AddHandler Application.DocumentManager.DocumentActivated, AddressOf AcadDocument_EndSave&lt;BR /&gt;AddHandler Application.SystemVariableChanged, AddressOf appSysVarChanged 'adicionado para o save&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;CommandMethod("RemoveAppEvent")&amp;gt;&lt;BR /&gt;Public Sub RemoveAppEvent()&lt;BR /&gt;RemoveHandler Application.SystemVariableChanged, AddressOf appSysVarChanged&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub AcadDocument_EndSave(ByVal DocumentCollection As Autodesk.AutoCAD.ApplicationServices.&amp;nbsp;&lt;BR /&gt;DocumentCollectionEventArgs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt;file = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\rita.aguiar\Documents\AutoCAD plug-in\Registo de Eventos.txt", True)&lt;BR /&gt;file.WriteLine("O documento foi guardado.")&lt;BR /&gt;file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub appSysVarChanged(ByVal senderObj As Object,&lt;BR /&gt;ByVal sysVarChEvtArgs As Autodesk.AutoCAD.ApplicationServices.&lt;BR /&gt;SystemVariableChangedEventArgs)&lt;/P&gt;&lt;P&gt;Dim oVal As Object = Application.GetSystemVariable(sysVarChEvtArgs.Name)&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt;file = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\rita.aguiar\Documents\AutoCAD plug-in\Registo de Eventos.txt", True)&lt;BR /&gt;file.WriteLine("O AutoCAD foi encerrado.")&lt;BR /&gt;file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 09:53:44 GMT</pubDate>
    <dc:creator>rita.aguiar</dc:creator>
    <dc:date>2018-09-07T09:53:44Z</dc:date>
    <item>
      <title>How to handle the EndSave event (.net vb)?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/how-to-handle-the-endsave-event-net-vb/m-p/8252214#M167162</link>
      <description>&lt;P&gt;How to handle the EndSave event (.net vb)?&lt;/P&gt;&lt;P&gt;I don't understand this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-ActiveX-Reference/files/GUID-D72C232D-82D9-4C63-9808-9E8CFE514B36-htm.html" target="_blank"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-3750.htm,topicNumber=d0e5186&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also I don't get it if it is a DocumentEvent or DocumentCollectionEvent.&lt;/P&gt;&lt;P&gt;Like what is the correct name of the event? I can't find it. And what name should the procedure have?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for an AutoCAD plugin which already registers when the user closes AutoCAD. I want it to register the EndSave as well, but I don't know how to do it. I've also attached an image to the code in visual studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;Imports Excel = Microsoft.Office.Interop.Excel&lt;BR /&gt;Imports System.IO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Class Class1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;CommandMethod("AddAppEvent")&amp;gt;&lt;BR /&gt;Public Sub AddAppEvent()&lt;BR /&gt;AddHandler Application.DocumentManager.DocumentActivated, AddressOf AcadDocument_EndSave&lt;BR /&gt;AddHandler Application.SystemVariableChanged, AddressOf appSysVarChanged 'adicionado para o save&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;CommandMethod("RemoveAppEvent")&amp;gt;&lt;BR /&gt;Public Sub RemoveAppEvent()&lt;BR /&gt;RemoveHandler Application.SystemVariableChanged, AddressOf appSysVarChanged&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub AcadDocument_EndSave(ByVal DocumentCollection As Autodesk.AutoCAD.ApplicationServices.&amp;nbsp;&lt;BR /&gt;DocumentCollectionEventArgs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt;file = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\rita.aguiar\Documents\AutoCAD plug-in\Registo de Eventos.txt", True)&lt;BR /&gt;file.WriteLine("O documento foi guardado.")&lt;BR /&gt;file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub appSysVarChanged(ByVal senderObj As Object,&lt;BR /&gt;ByVal sysVarChEvtArgs As Autodesk.AutoCAD.ApplicationServices.&lt;BR /&gt;SystemVariableChangedEventArgs)&lt;/P&gt;&lt;P&gt;Dim oVal As Object = Application.GetSystemVariable(sysVarChEvtArgs.Name)&lt;/P&gt;&lt;P&gt;Dim file As System.IO.StreamWriter&lt;BR /&gt;file = My.Computer.FileSystem.OpenTextFileWriter("C:\Users\rita.aguiar\Documents\AutoCAD plug-in\Registo de Eventos.txt", True)&lt;BR /&gt;file.WriteLine("O AutoCAD foi encerrado.")&lt;BR /&gt;file.Close()&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;End Class&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 09:53:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/how-to-handle-the-endsave-event-net-vb/m-p/8252214#M167162</guid>
      <dc:creator>rita.aguiar</dc:creator>
      <dc:date>2018-09-07T09:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the EndSave event (.net vb)?</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/how-to-handle-the-endsave-event-net-vb/m-p/8266098#M167163</link>
      <description>&lt;P&gt;There is no EndSave Event. I have to create it if I want to use it.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:15:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/how-to-handle-the-endsave-event-net-vb/m-p/8266098#M167163</guid>
      <dc:creator>rita.aguiar</dc:creator>
      <dc:date>2018-09-13T15:15:20Z</dc:date>
    </item>
  </channel>
</rss>

