<?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: Fatal Error AutoCAD 2016 in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7616583#M6791</link>
    <description>&lt;P&gt;Thanks Sajith,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try this with no effect. It seems the code completes correctly, but causes AutoCAD to crash after completion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read about modifying mapped properties, however the properties I am changing and mapped in a single direction with the Vault property as the master. The file will update when the properties are synchronised. Works fine for this application.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2017 12:30:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-12T12:30:47Z</dc:date>
    <item>
      <title>Fatal Error AutoCAD 2016</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7601323#M6789</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting a fatal error in AutoCAD 2016 caused by UpdateFileProperties during an AddFileEvents.Post event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the first error message:&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="vaulting error.JPG" style="width: 362px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/435576iE9DDD138BFD3BEFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vaulting error.JPG" alt="vaulting error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Followed by:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Fatal error.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/435577iC8BD1BD3643F2A4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Fatal error.JPG" alt="Fatal error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code runs flawlessly, and always completes successfully.&lt;/P&gt;&lt;P&gt;This is not an issue for inventor or office files and only seems to be an issue with AutoCAD files.&lt;/P&gt;&lt;P&gt;I have debugged the code, and its the "VaultExplorerUtil.UpdateFileProperties(indfile, propsDict)" that causes the issue, when this line is removed, the error does not occur.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if there is an issue with my code, or the AutoCAD add in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub OnLoad() Implements IWebServiceExtension.OnLoad

            AddHandler DocumentService.AddFileEvents.Post, AddressOf AddCreatorAndDateOnAddFile


        End Sub

        Private Sub AddCreatorAndDateOnAddFile(ByVal sender As Object, ByVal e As AddFileCommandEventArgs)

            'establish a connection to vault with current users details
            Dim results As VDF.Vault.Results.LogInResult
            Dim OrgName As String = System.Environment.UserName
            If e.FileName.EndsWith(".dwf") Or e.FileName.EndsWith(".DWF") Then
                Return
            End If
                            results = VDF.Vault.Library.ConnectionManager.LogIn("xxxxxxxx", "xxxxxxxx", "", "", VDF.Vault.Currency.Connections.AuthenticationFlags.WindowsAuthentication, Nothing)

            If Not results.Success Then
                Return
            End If
            Dim m_conn As Connection = results.Connection

            'get file id
            Dim FileNme As String = Right(e.FileName, Len(e.FileName) - InStrRev(e.FileName, "\"))
            Dim IndFileId As Long
            Dim AllFilesInFolder As File() = m_conn.WebServiceManager.DocumentService.GetLatestFilesByFolderId(e.FolderId, True)
            For Each Sepfile As File In AllFilesInFolder
                If Sepfile.Name = FileNme Then
                    IndFileId = Sepfile.Id
                    Exit For
                End If
            Next Sepfile

            'Get orginator name
            OrgName = Right(OrgName, Len(OrgName) - InStrRev(OrgName, "\")) 'remove domain
            OrgName = Replace(OrgName, ".", " ") 'replace the period with a space
            OrgName = StrConv(OrgName, VbStrConv.Uppercase) 'convert to uppercase

            'Get orginal create date
            Dim OrgDateDte As Date = Now
            Dim OrgDate As String = OrgDateDte.ToShortDateString

            'change properties
            'create dictionary
            Dim myPropDefArray As PropDef() = m_conn.WebServiceManager.PropertyService.FindPropertyDefinitionsBySystemNames("FILE", New String() _
                {"5716a6eb-53c9-4fb3-b13d-205edfc714c4", "505a747a-d62a-4a8b-bff9-2e149daafce2"})
            Dim propsDict As Dictionary(Of PropDef, Object) = New Dictionary(Of PropDef, Object)
            Dim OrgNameObj As Object = OrgName
            Dim OrgDateObj As Object = OrgDate

            propsDict.Add(myPropDefArray(0), OrgNameObj)
            propsDict.Add(myPropDefArray(1), OrgDateObj)

            'Load ExplorerUtil
            Dim VaultExplorerUtil As IExplorerUtil = ExplorerLoader.LoadExplorerUtil(m_conn.Server, m_conn.Vault, m_conn.UserID, m_conn.Ticket)

            'change properties
            Dim indfile As File = m_conn.WebServiceManager.DocumentService.GetFileById(IndFileId)
            Processing = True
            VaultExplorerUtil.UpdateFileProperties(indfile, propsDict)
            Processing = False

            'Close ExplorerUtil
            VaultExplorerUtil = Nothing

            'loggout of the vault server
            VDF.Vault.Library.ConnectionManager.LogOut(m_conn)

        End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 14:55:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7601323#M6789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-06T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fatal Error AutoCAD 2016</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7613199#M6790</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try wrapping your method in a Try/Catch block and see if you can find any additional details about the exception.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually it is not recommended to modify mapped properties from an event handler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sajith&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:42:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7613199#M6790</guid>
      <dc:creator>sajith_subramanian</dc:creator>
      <dc:date>2017-12-11T11:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fatal Error AutoCAD 2016</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7616583#M6791</link>
      <description>&lt;P&gt;Thanks Sajith,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try this with no effect. It seems the code completes correctly, but causes AutoCAD to crash after completion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read about modifying mapped properties, however the properties I am changing and mapped in a single direction with the Vault property as the master. The file will update when the properties are synchronised. Works fine for this application.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 12:30:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7616583#M6791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-12T12:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fatal Error AutoCAD 2016</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7631017#M6792</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you confirm that this issue you are facing is not machine specific. Do you have any other machines with similar setups on which you can try running&amp;nbsp;your code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sajith&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 05:53:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7631017#M6792</guid>
      <dc:creator>sajith_subramanian</dc:creator>
      <dc:date>2017-12-18T05:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fatal Error AutoCAD 2016</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7631155#M6793</link>
      <description>&lt;P&gt;Hi Sajith,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can confirm this error was common across 8 machines, using the latest firmware, and after multiple clean reinstallations.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 07:47:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/fatal-error-autocad-2016/m-p/7631155#M6793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-18T07:47:58Z</dc:date>
    </item>
  </channel>
</rss>

