I have a VB.net program that starts Inventor and creates an assembly. Could anyone tell me if it would be possible to run this application from another workstation on our network. Salesmen create some data with their configurator. I'd like to have then click a button and start Inventor on another workstation or server and create a model for them. My program does this but I don't know if/how to run it from another machine. Obviously I don't want to install Inventor on salesman's machines. I know this is likely more a VB question and I've search but no luck. Any direction is appreciated. Thanks.
Rosco
Inventor 2013
Visual Studio 10
WIndows 7
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
Yes, I've do this in a few applications a few diffrent ways.
1. Simply use WMI to start Inventor on the Remote Machine
http://msdn.microsoft.com/en-us/library/aa389769(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa389388(v=vs.85).aspx
OR
2. Call a batch/cmd script on the remote machine that opens Inventor
Either way, you would remote like this:
Try Dim options As New System.Management.ConnectionOptions options.Username = userNameBox.Text options.Password = passwordBox.Text Dim path As New System.Management.ManagementPath("\\" + ip + "\root\CIMV2:Win32_Process") Dim scope As New System.Management.ManagementScope(path, options) Dim opt As New System.Management.ObjectGetOptions() Dim classInstance As New System.Management.ManagementClass(scope, path, opt) Dim inParams As System.Management.ManagementBaseObject = classInstance.GetMethodParameters("Create") inParams("CommandLine") = ExeBox.Text ' Execute the method and obtain the return values. Dim outParams As System.Management.ManagementBaseObject = classInstance.InvokeMethod("Create", inParams, Nothing) Return "ReturnValue:" & outParams("returnValue") & " Process ID: {0}" & outParams("processId") & " IP = " & ip Catch err As Exception execproc = "Starting process has been failed on " & ip & " " & err.Message MessageBox.Show("An error occured while trying" & _ " to execute the WMI method: " & err.Message) End Try
jdkriek wrote:
Yes, I've do this in a few applications a few diffrent ways.
1. Simply use WMI to start Inventor on the Remote Machine
http://msdn.microsoft.com/en-us/library/aa389769(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa389388(v=vs.85).aspx
OR
2. Call a batch/cmd script on the remote machine that opens Inventor
Either way, you would remote like this:
Try Dim options As New System.Management.ConnectionOptions options.Username = userNameBox.Text options.Password = passwordBox.Text Dim path As New System.Management.ManagementPath("\\" + ip + "\root\CIMV2:Win32_Process") Dim scope As New System.Management.ManagementScope(path, options) Dim opt As New System.Management.ObjectGetOptions() Dim classInstance As New System.Management.ManagementClass(scope, path, opt) Dim inParams As System.Management.ManagementBaseObject = classInstance.GetMethodParameters("Create") inParams("CommandLine") = ExeBox.Text ' Execute the method and obtain the return values. Dim outParams As System.Management.ManagementBaseObject = classInstance.InvokeMethod("Create", inParams, Nothing) Return "ReturnValue:" & outParams("returnValue") & " Process ID: {0}" & outParams("processId") & " IP = " & ip Catch err As Exception execproc = "Starting process has been failed on " & ip & " " & err.Message MessageBox.Show("An error occured while trying" & _ " to execute the WMI method: " & err.Message) End Try
you do this at your work to make template models from sales? does it work good? i like try to
hey you no anser to help me... i do search
very funny you code look like this one...
http://social.msdn.microsoft.com/forums/en-US/9c03a9a7-55cc-4c7d-978e-36f453423b2b/remote-execute