Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open webpage after running a ilogic rule, inventor professional 2025

4 REPLIES 4
Reply
Message 1 of 5
mrc4nl
70 Views, 4 Replies

Open webpage after running a ilogic rule, inventor professional 2025

Hi, I created a webpage for calculating purposes, and I have made a ilogic rule to make and export the parameters, than it opened the results page in a browser. This did work as intended in Inventor 2024.

 

However something changed in ilogic behavour in 2025 and now it wont open the webpage after its completed.

 

Imports System.IO

Opendoc = ThisApplication.ActiveDocument

Try
System.Diagnostics.Process.Start("http://server/calculatie2.php?tekening=" & Left(Opendoc.DisplayName,Len(Opendoc.DisplayName)-4))
Catch
  MessageBox.Show("Could Not Open WebPage", "iLogic")
End Try

 

 

So is there a other way I can redirect to a webpage? 

 CreateObject("WScript.Shell").Run "https://server/"

Does  also not work

4 REPLIES 4
Message 2 of 5
WCrihfield
in reply to: mrc4nl

Hi @mrc4nl.  I am still using 2024.3, but I have heard that 2025 is more strict where variables are concerned, than it used to be, so I believe that you should always (whenever possible) 'declare' your variables (using Dim keyword), and specify their Type when declaring them.  If the Type may change (varies) then declare it 'As Object'.  In your case, you seem to be using a variable named "Opendoc".  Try changing that line of code to:

Dim Opendoc As Inventor.Document = ThisApplication.ActiveDocument

And in your second example code, where you are using 'CreateObject', you should try to do the same, and split that line of code up into multiple lines.  For example, declare a variable to hold what you get from using that immediate Function (I am not sure about what Type to expect right now, but maybe a Process), then set its value with that function.  Then on the next line, try using the 'Run' method on it.

Also, did you know that we can create our own Inventor.WebBrowserDialog?  Under the main application object is a property (Application.WebBrowserDialogs), which will give you the WebBrowserDialogs collection object.  Then we can use its WebBrowserDialogs.Add method to create a new WebBrowserDialog object.  Then we can use its WebBrowserDialog.Navigate method to browse to a website.  There is more available about them in the online help, if interested.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5
mrc4nl
in reply to: WCrihfield

I usually don't declare my variables, I only set them to a initial value.  I know its bast practice to declare them, however the ilogic script does generate the output that I want, it only skips the last step in displaying the result page. So i don't think that's the main issue here.

 

i found the second code example somewhere on a VB code site, i am not sure if will work for ilogic. it gave me syntax errors.

 

I will look into the WebBrowserDialog api, thanks.

 

 

 

 

Message 4 of 5
JelteDeJong
in reply to: WCrihfield

You can try this:

Try
	Dim Opendoc = ThisDoc.Document
	Dim fileName = System.IO.Path.GetFileNameWithoutExtension(Opendoc.FullFileName)
	Dim url = $"http://server/calculatie2.php?tekening={fileName}"
	
	Dim startInfo As ProcessStartInfo = New ProcessStartInfo(url)
	startInfo.UseShellExecute = True
	
	Process.Start(startInfo)

Catch ex As Exception
	MessageBox.Show($"Could Not Open WebPage. Message: {ex.Message}", "iLogic")
End Try

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 5
Curtis_Waguespack
in reply to: mrc4nl

@mrc4nl just as a hint for the future, when we're debugging, it's often helpful to take the code out of the try/catch so we can see the actual error that is being generated, and not just the message we are using in the catch statement.

 

In any case, similar to JelteDeJong's example, note that you can specify the browser to open the site in also, in case that's of interest.

 

sSite = "https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/bd-p/120"

Dim OpenWithChrome As New ProcessStartInfo With {
.UseShellExecute = True,.FileName = "Chrome.exe",.Arguments = sSite}
Process.Start(OpenWithChrome)

'or 

Dim OpenWithExplorer As New ProcessStartInfo With {
.UseShellExecute = True,.FileName = "Explorer.exe",.Arguments = sSite}
Process.Start(OpenWithExplorer)

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report