<?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: Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12945022#M170347</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5971766"&gt;@ChristianAhlers&lt;/a&gt;.&amp;nbsp; I am not familiar with writing code in C#.net, but I can follow your code OK, due to how similar it is to vb.net.&amp;nbsp; I just checked on the Form.ShowDialog official documentation website (link below), and it says that this applies to .NET Framework 4.8.1 and other versions.&amp;nbsp; It does not mention regular .NET, so I can only assume that it will no longer work with the newer system being used in Inventor 2025, since they stepped forward to using regular .NET.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.showdialog" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.showdialog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same for the DialogResult Enum..., because it is .NET Framework 4.8.1 (and earlier), and Windows Desktop 9 and earlier.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.dialogresult" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.dialogresult&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will be interested in seeing the next best alternatives myself, because I still use that method in several of the solutions where I work.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; The &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form" target="_blank" rel="noopener"&gt;System.Windows.Forms.Form&lt;/A&gt; object is the same way.&amp;nbsp; I am not sure if the whole &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms" target="_blank" rel="noopener"&gt;System.Windows.Froms&lt;/A&gt; Namespace is only supported in those code systems listed above or not.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 17:57:05 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2024-08-07T17:57:05Z</dc:date>
    <item>
      <title>Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12943915#M170318</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to overwrite the default save dialog and replace it with my own. I have already done this in previous versions of Inventor and it worked without any problems.&lt;BR /&gt;But now, in version 2025, I have no success.&lt;/P&gt;&lt;P&gt;The event is registered in the Activate function of my plugin and does not throw an error. However, when I then save and my own dialog should appear, only the standard Inventor dialog appears.&lt;/P&gt;&lt;P&gt;Can anyone recognize an error or has a similar problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my short code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public void Activate ( Inventor.ApplicationAddInSite addInSiteObject, bool firstTime )
 {
     // This method is called by Inventor when it loads the addin.
     // The AddInSiteObject provides access to the Inventor Application object.
     // The FirstTime flag indicates if the addin is loaded for the first time.

     // Initialize AddIn members.
     m_inventorApplication = addInSiteObject.Application;          

     FileUIEvents fileUIEvents = m_inventorApplication.FileUIEvents;
     fileUIEvents.OnFileSaveAsDialog += FileUIEvents_OnFileSaveAsDialog;

     // TODO: Add ApplicationAddInServer.Activate implementation.
     // e.g. event initialization, command creation etc.
 }



 private void FileUIEvents_OnFileSaveAsDialog ( ref string[ ] FileTypes, bool SaveCopyAs, int ParentHWND, out string FileName, NameValueMap Context, out HandlingCodeEnum HandlingCode )
 {
     SaveDialog saveDialog = new SaveDialog( );

     bool result = ( bool ) saveDialog.ShowDialog( );

     if ( result )
     {
         HandlingCode = HandlingCodeEnum.kEventCanceled;
         FileName = null;
     }
     else
     {
         HandlingCode = HandlingCodeEnum.kEventCanceled;
         FileName = null;
     }

 }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 08:54:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12943915#M170318</guid>
      <dc:creator>ChristianAhlers</dc:creator>
      <dc:date>2024-08-07T08:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12945022#M170347</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5971766"&gt;@ChristianAhlers&lt;/a&gt;.&amp;nbsp; I am not familiar with writing code in C#.net, but I can follow your code OK, due to how similar it is to vb.net.&amp;nbsp; I just checked on the Form.ShowDialog official documentation website (link below), and it says that this applies to .NET Framework 4.8.1 and other versions.&amp;nbsp; It does not mention regular .NET, so I can only assume that it will no longer work with the newer system being used in Inventor 2025, since they stepped forward to using regular .NET.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.showdialog" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.showdialog&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same for the DialogResult Enum..., because it is .NET Framework 4.8.1 (and earlier), and Windows Desktop 9 and earlier.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.dialogresult" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.dialogresult&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will be interested in seeing the next best alternatives myself, because I still use that method in several of the solutions where I work.&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; The &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form" target="_blank" rel="noopener"&gt;System.Windows.Forms.Form&lt;/A&gt; object is the same way.&amp;nbsp; I am not sure if the whole &lt;A href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms" target="_blank" rel="noopener"&gt;System.Windows.Froms&lt;/A&gt; Namespace is only supported in those code systems listed above or not.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 17:57:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12945022#M170347</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-08-07T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Betreff: Inventor FileUIEvent.OnFileSaveAsDialog overwrite default dialog not working</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12946020#M170367</link>
      <description>&lt;P&gt;Hi Wesley,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope the Inventor team give us an alternative if the function will not longer work in .net.&lt;/P&gt;&lt;P&gt;Thank you for your listings.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 04:50:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-fileuievent-onfilesaveasdialog-overwrite-default-dialog/m-p/12946020#M170367</guid>
      <dc:creator>ChristianAhlers</dc:creator>
      <dc:date>2024-08-08T04:50:21Z</dc:date>
    </item>
  </channel>
</rss>

