Simple iLogic Progress Bar

@ClintBrown3D - Simple iLogic Progress Bar Autodesk Inventor

I’ve previously shared a blog post on how to hack the Inventor Progress bar in iLogic. But sometimes this can be quite a lot of work (to code), or the process that you are showing a progress bar for, does not have any steps to iterate through, which makes the official progress bar tricky to use.

To get around this, I thought of showing an iLogic form with an embedded GIF file, but animated GIF’s are currently not supported. I then found an API sample for displaying web browsers, and this got me thinking! The idea, was to use the web browser as the progress bar.
WARNING: This works well with Inventor 2020… experience with earlier versions is not great, and I have no idea how this will work with newer versions of Inventor.

I’ve also written a few blog posts, looking at using random numbers (see Magic 8 Ball“, “Coin Tosser” and “Random Face Colour“), so I thought I would bring random numbers and the web browser together to create a random progress bar. The results would look something like the animation below:

@ClintBrown3D - Autodesk Inventor iLogic Lazy Progress Bar
Click me for higher res version

One thing that you will need to do (on every PC), is manually size the web browser (you only need to do this once).

The animated GIF (used for the progress bar) could be stored on your server, but in this instance, I have used online images, so the PC will need to be connected to the internet for this to work.

The code is really simple, it randomly chooses a URL, creates the web browser, runs some code (see section to insert your own code), then deletes the browser.

Here is the iLogic code:

'iLogic code by @ClintBrown3D, originally posted at https://clintbrown.co.uk/simple-ilogic-progress-bar

RANDOMISER = Round(Rnd * 5) 'Generate a Random number between 0 & 6
If RANDOMISER = 0 Then: RANDOMISER = "https://i.imgur.com/tUTwXxA.gif"
	Else If RANDOMISER = 1 Then: RANDOMISER = "https://i.imgur.com/EpygR1m.gif" 
	Else If RANDOMISER = 2 Then: RANDOMISER = "https://i.imgur.com/QxmpMd5.gif"
	Else If RANDOMISER = 3 Then: RANDOMISER = "https://i.imgur.com/ZjweY4x.gif"
	Else If RANDOMISER = 4 Then: RANDOMISER = "https://i.imgur.com/JuU08.gif"
	Else If RANDOMISER = 5 Then: RANDOMISER = "https://i.imgur.com/EpygR1m.gif"
	Else If RANDOMISER = 6 Then: RANDOMISER = "https://i.imgur.com/2ml5xJq.gif": End If
oURL = RANDOMISER

'-----------------------------------------------------------------------------------------------------
' Create a WebBrowserDialog (Progress Bar)
	Dim oWebBrowserDialog As WebBrowserDialog
	oWebBrowserDialog = ThisApplication.WebBrowserDialogs.Add(oURL)
	oWebBrowserDialog.WindowState = kNormalWindow 'kMaximisedWindow

' Nagigate To a Web site
	oWebBrowserDialog.Navigate(oURL)
'----------------------------------------------------------------------------------------------------------
'Your iLogic Rule goes in here:
MessageBox.Show("iLogic Progress Bar", "@ClintBrown3D")

'----------------------------------------------------------------------------------------------------------
oWebBrowserDialog.Delete

Watch this space, I shall be publishing a blog post soon, with code that uses this type of progress bar!