<?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 Access Context outside CommandHandler in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12362379#M1305</link>
    <description>&lt;P&gt;Good morning everyone,&lt;BR /&gt;I try to explain as best as I can what my application does and what the problem is.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In Vault 2023 (C#) I developed a custom search form.&lt;BR /&gt;By this form it's possible to search for items through their UDP (I mean some internal Company classification properties). Once the search is completed, with a click on the result row, the context returns to the Vault which navigates to the selected item.&lt;BR /&gt;As far I have successfully used a ShowDialog to open the modal Form and retrieve the result upon closing and GOTO the item. This is all done inside the CommandHandler routine (therefore using e.Context.GoToLocation). Everything works like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the request is that this form remains available on demand, on a second monitor, in order to allow the user to use the Vault and recall the form to perform searches if necessary.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In order to reach the goal I pass the CommandItemEventArgs to the non-modal form when I instantiate and open it.&lt;BR /&gt;On item selection I hide the form and through the Hide event (with Close event I get a Vault crash) I retrieve the value of the selected item and try to navigate to that item in the Vault.&lt;/P&gt;&lt;P&gt;These operations no longer take place within the CommandHandler but rather in the FormSearchVisibleChanged routine (invoked by the Hide event).&lt;BR /&gt;In debug I see that the original context is intact but despite this it doesn't work.&lt;/P&gt;&lt;P&gt;At the moment it seems that the only way to access the context is within its CommandHandler.&lt;BR /&gt;Apologies for the length of the introduction.&lt;BR /&gt;Now the question:&lt;BR /&gt;Is it possible to access the context if it is passed to a routine external to the CommandHandler?&lt;/P&gt;&lt;P&gt;Any other ways to manage or rethink the solution?&lt;BR /&gt;Thank you very much in advance for your patience and kind support&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 10:50:22 GMT</pubDate>
    <dc:creator>GabrieleZelasco</dc:creator>
    <dc:date>2023-11-08T10:50:22Z</dc:date>
    <item>
      <title>Access Context outside CommandHandler</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12362379#M1305</link>
      <description>&lt;P&gt;Good morning everyone,&lt;BR /&gt;I try to explain as best as I can what my application does and what the problem is.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In Vault 2023 (C#) I developed a custom search form.&lt;BR /&gt;By this form it's possible to search for items through their UDP (I mean some internal Company classification properties). Once the search is completed, with a click on the result row, the context returns to the Vault which navigates to the selected item.&lt;BR /&gt;As far I have successfully used a ShowDialog to open the modal Form and retrieve the result upon closing and GOTO the item. This is all done inside the CommandHandler routine (therefore using e.Context.GoToLocation). Everything works like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the request is that this form remains available on demand, on a second monitor, in order to allow the user to use the Vault and recall the form to perform searches if necessary.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In order to reach the goal I pass the CommandItemEventArgs to the non-modal form when I instantiate and open it.&lt;BR /&gt;On item selection I hide the form and through the Hide event (with Close event I get a Vault crash) I retrieve the value of the selected item and try to navigate to that item in the Vault.&lt;/P&gt;&lt;P&gt;These operations no longer take place within the CommandHandler but rather in the FormSearchVisibleChanged routine (invoked by the Hide event).&lt;BR /&gt;In debug I see that the original context is intact but despite this it doesn't work.&lt;/P&gt;&lt;P&gt;At the moment it seems that the only way to access the context is within its CommandHandler.&lt;BR /&gt;Apologies for the length of the introduction.&lt;BR /&gt;Now the question:&lt;BR /&gt;Is it possible to access the context if it is passed to a routine external to the CommandHandler?&lt;/P&gt;&lt;P&gt;Any other ways to manage or rethink the solution?&lt;BR /&gt;Thank you very much in advance for your patience and kind support&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 10:50:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12362379#M1305</guid>
      <dc:creator>GabrieleZelasco</dc:creator>
      <dc:date>2023-11-08T10:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Access Context outside CommandHandler</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365785#M1306</link>
      <description>&lt;P&gt;The context is only valid for the duration of the command. It's because the command has a prologue and an epilogue. There is some tasks to do before Vault can execute the command, and some other tasks to do after the command (like for instance refresh the UI if ForceRefresh is true).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no way to handle a modeless window with the API in its current state. To make it works, Autodesk should give us a way to switch to a command context to execute code, like you can do in AutoCAD or Revit.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 13:52:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365785#M1306</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2023-11-09T13:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Access Context outside CommandHandler</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365816#M1307</link>
      <description>&lt;P&gt;I don't see a direct option either; however,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12122356"&gt;@GabrieleZelasco&lt;/a&gt;,&amp;nbsp;you could implement a workaround leveraging the Thick Client link option: create a link download file (*.acr) for the navigation target like Vault Send Link... A client configured to open *.acr files with Connectivity.VaultPro.exe as a default application will navigate to the given entity.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 14:03:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365816#M1307</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2023-11-09T14:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Access Context outside CommandHandler</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365833#M1308</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Maxence DELANNOY you're so right, clear and relevant explanation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Markus&amp;nbsp;&lt;SPAN&gt;Koechl&lt;/SPAN&gt; I will definitely try the workaround, in case I will ask you for some more hints.&lt;/P&gt;&lt;P&gt;Many thanks to both of you for the information and suggestions!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 14:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/access-context-outside-commandhandler/m-p/12365833#M1308</guid>
      <dc:creator>GabrieleZelasco</dc:creator>
      <dc:date>2023-11-09T14:12:57Z</dc:date>
    </item>
  </channel>
</rss>

