Changing focus to BricsCAD v14 using VBA

I have a VBA app in Excel that draws some objects in BricsCAD. Then, I want to give focus to BricsCAD, so the user can continue to work. I have tried the following without success,
acadApp.Visible = True
Note that earlier in the program the acadApp variable is set to be the BricsCAD app. But, the .visible setting does not seem to have any effect. If I type, the Excel app is what gets the letters.

I see that in v14 of AutoCAD, the method, Window.Focus was added.

The word "Focus" is not in the BricsCAD developer help document. After some internet searches, I found a page that indicates you must load the reference called, "AutoCAD Focus Control for VBA Type Library"

Is there a similar library for BricsCAD?

-Joe

Comments

  • Roy Klein Gebbinck
    edited February 2017

    Try using the VBA AppActivate statement.

  • I have tried the following without success.

    AppActivate.acadApp ' doesn't work. Says argument is not optional.

    AppActivate Shell("C:\Program Files (x86)\Bricsys\BricsCAD V14 en_US\bricscad.exe", 1) 'Above doesn't work. Says invalid procedure or call

    -Joe

  • Roy Klein Gebbinck
    edited February 2017

    Your first suggestion obviously won't work. Why the second fails I do not know.

    Try this SendKey example.
    If you can't get that to work you should consult your IT department. Your system's security may be too tight.

  • After a bunch of trial-and-error, I ended up with this method working.
    AppActivate "BricsCAD"

    Thank you all for your suggestions, working or not.
    -Joe

This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. Click one of the buttons on the top bar to get involved!