Book a Demo

Author Topic: Progress  bar, prevent user actions with VBScript  (Read 6975 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Progress  bar, prevent user actions with VBScript
« on: August 19, 2015, 05:02:22 pm »
Hi,

I've got a script in EA written in VB that runs a number of updates throughout the project.
I'm looking for a way to prevent users from accessing the models whilst the script is running (e.g. prevent from opening a diagram, element, etc.)
This could be notified via a simple popup window or progress bar.

Have you got any suggestion in achieving this with VBScript?

Thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Progress  bar, prevent user actions with VBScr
« Reply #1 on: August 19, 2015, 05:21:54 pm »
I guess you'll have to use a background thread for processing and a normal thread to show the dialog with progress bar.

But I'm not sure if VBScript can handle multithreading at all. :-?

Geert

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Progress  bar, prevent user actions with VBScr
« Reply #2 on: August 19, 2015, 05:43:34 pm »
Thanks Geert.
I went for a more simple solution by showing a popup for 20 seconds. As I'm displaying a message at the end of the execution via a Session.Prompt, this popup window is then automatically closed.

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Popup  "Please wait for the script to end before using the model.", 3, "Progress"
« Last Edit: August 19, 2015, 06:33:43 pm by gfuk »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Progress  bar, prevent user actions with VBScr
« Reply #3 on: August 19, 2015, 07:02:42 pm »
Nice!
Thanks Guillaume, that might come in handy someday.

Geert