How to start Inventor with VB.NET in a different language?

How to start Inventor with VB.NET in a different language?

Anonymous
Not applicable
1,564 Views
3 Replies
Message 1 of 4

How to start Inventor with VB.NET in a different language?

Anonymous
Not applicable

Hi to all, is there a way to open Inventor.exe in different language (English or French)?  I already loaded the French Language pack.

 

See below part of a VB.NET program:

 

Imports System

Imports System.Type

Imports System.Activator

Imports System.Runtime.InteropServices

Imports Inventor

 

Public Class Form1

 

   Dim _invApp As Inventor.Application

   Dim _started As Boolean

 

   Public Sub New()

 

       ' This call is required by the designer.

       InitializeComponent()

 

 

       ' Add any initialization after the InitializeComponent() call.

       Try

           _invApp = Marshal.GetActiveObject("Inventor.Application")

       Catch ex As Exception

           Try

               Dim oInvAppType As Type = GetTypeFromProgID("Inventor.Application")

 

               _invApp = CreateInstance(oInvAppType)

 

               'I would like to select from the two below:

               'Shortcut English: Inventor shortcut "C:\Program Files\Autodesk\Inventor 2016\Bin\Inventor.exe" /language=ENU

               'Shortcut French: Inventor shortcut "C:\Program Files\Autodesk\Inventor 2016\Bin\Inventor.exe" /language=FRA

 

               _invApp.Visible = True

 

               'Note: if you shut down the Inventor session that was started

               'this(way) there is still an Inventor.exe running. We will use

               'this Boolean to test whether or not the Inventor App will

               'need to be shut down.

               _started = True

 

           Catch ex2 As Exception

               MsgBox(ex2.ToString())

               MsgBox("Unable to get or start Inventor")

           End Try

       End Try

 

       Me.TopMost = True

 

   End Sub

0 Likes
Accepted solutions (1)
1,565 Views
3 Replies
Replies (3)
Message 2 of 4

YuhanZhang
Autodesk
Autodesk

Currently a workaround maybe that you change the Inventor.ini file to switch the language for Inventor, you can find the Inventor.ini from the Inventor installation location, usually it is C:\Program Files\Autodesk\Inventor 201x\Bin\Inventor.ini. There is a setting DefaultLanguage=ENU, you can modify the language to switch it. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 4

Owner2229
Advisor
Advisor
Accepted solution

You can start Inventor with Process.Start() and then get it with GetActiveObject():

 

Process.Start("C:\Program Files\Autodesk\Inventor 2016\Bin\Inventor.exe", " /language=FRA")
Threading.Thread.Sleep(1000) 'Give Inventor some time to start-up
_invApp = Marshal.GetActiveObject("Inventor.Application")

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi Mike, that was a big help for me.

 

Thank's again!

Alain

0 Likes