Using COM Automation to quick-start Bentley Maxsurf v18

The latest version of Maxsurf is Bentley Maxsurf V18i. You can download this version from Formsys and Bentley site, in which you’ll get a 15-days fully functional trial version. Afterwards, you can purchase the license via Bentley Select Licensing. If you’re from Malaysia, you can get the license from Caidmark Sdn Bhd.

Okay let’s jump into the good stuff. If you are using the Trial Version, you’ll be:

1. Notified each time by a pop-up which check your license’s status,

2. clicking the trial button,

3. clicking the selection of hull and,

4. finally arrive at the design space.

An awesome person (like you and me) will definitely automate these actions and go fishing. The step will be shorten to:

1. Clicking our newly-made programme, and
2. Voila there goes our design space!

You’ll be using Autoit V3. Make sure you get familiar with the software (approximate time: 10 minutes). It is basically a programme to automate your action in Windows. However you can also use it to write complex programme. It’s basically based on BASIC programming language. (Wow, 2 puns in one paragraph!)

1. First, you’ll need to copy-paste the codes below. Take note that the path of my Bentley Maxsurf is default.

2. Save it somewhere in a folder (not in the desktop, Windows permission doesn’t like this behaviour, Windows will probably kill your cat).

3. Compile it to EXE (using AutoIt compile function)

; Maxsurf Start
; by: Dr. Ahmad Faisal Mohamad Ayob
; 21 July 2012

; Initiate COM object of Maxsurf within our programme
$oMaxsurf = ObjCreate("Maxsurf.Application")

; Run EXE path of Maxsurf Modeler Advanced 64 bit
Run ("C:Program FilesBentleyEngineeringMaxsurf 18 V8iMaxsurfModelerAdvanced64.exe")

; Wait for Licensing Options -> Choose default (Trial) and send {Enter}
WinWaitActive("No License Found")
Send ("{ENTER}")

; Wait for Maxsurf Quick Start hull options and send {ESC} to invoke the default design space
WinWaitActive("Maxsurf Professional Quick Start")

Voila! You’ve just finished your first automation programme! (Well technically it’s mine, but I gave it to you, you’re welcome).

What we are expecting is, once you clicked your programme, it will do all the clickity-clack above and brings you the design space.

Happy coding!

p/s: You want to have the final compiled EXE? Grab it here.