BricsCAD V9 - VBA - GetPoint problem

Hello.

I've got plenty of old vba macros written for autocad 2004. Now I'm trying them in BricsCAD V9. The problem is with the method getpoint:

        center = ThisDrawing.Utility.GetPoint(, "Prompt:  ")

It worked ok in autocad. In BricsCAD it doesn't. When I start the macro it works ok until it gets to this line. The "Prompt" appears in the commandline. The program doesn't wait for the point to be shown (selected). The program "hangs" - i can't terminate it, i can't turn the BricsCAD off. Ctrl+Alt+Del helps.

BUT! If I use Step Into (F8) from menu Debug and perform the macro "one line after another" everything from the Begin Sub(), including this line and further code, to the End. works correctly...

Where is the problem?

P.S. I'm not a developer. I write simple macros. I'm hoping for Your help.

wojtek

Comments

  • The problem isn't in fact the problem. GetPoint, GetString and other Gets... work fine. Wheather I start it with Step Into (F8) from Debug menu or Run (F5) from Run menu.

    What I didn't mention before, is that I start vba macros using LISP. I have my old lisp codes that worked with autocad 2004.

    (defun C:vba_macro_short_name ( )
    (command "_-vbarun" "macro_name")
    );defun

    VBAMacros that don't use GetSomething methods work fine.

    Macros with Gets... fail. They seem to be started with a parameter or something... I don't know. This lisp code is the only one I have ever written.

    What's wrong?

    looking for Your help

    wojtek

  • Hi Wojtek,

    It is difficult to judge what might be the problem you are encountering: For me, both the .Get.. commands work, and I can start my macro's with a lisp command, just the way you use it as well.Maybe you can post your macro here, so we can see what goes on?

    By the way. to make your Prompt appear under the command line you can add an Carriage return character (vbCr):

    center = ThisDrawing.Utility.GetPoint(, vbCr &"Prompt:  ")

    Gerrit

  • Thank You for Your reply.

    Here I post the simple macro that when started with Run (F5) from menu Run works fine.

    Public variant_variable As Variant
    Public string_variable As String

    Sub simple_macro()

    variant_variable = ThisDrawing.Utility.GetPoint(, "pick a point")
    string_variable = ThisDrawing.Utility.GetString(30, "enter text")

    msgbox string_variable

    End Sub

     

    And started by LISP fails:

    (defun C:smpl()
    (command "_-vbarun" "simple_macro")
    );defun

     

    Command line looks like that:

    : smpl
    : _-vbarun
    Nazwa macro: simple_macro                        
    (I use polish bricscad - "Nazwa macro" means "Macro Name")
    pick a point
    :

    The program doesn't wait for the point. Cursor doesn't get the shape like when waiting for a point, but looks and works like when selecting objects. BricsCAD works well later - I can draw, save and open drawings. VBA "hangs" - can't stop the macro.

    Other macros that don't use .Gets work well started with LISP.

  • It works here, but then I run the latest version of BricscadPro (10.2.14).

    This is my output:

    : smpl
    : _-vbarun
    Macro name: simple_macro
    pick a point
    pick a point
    enter textMyText

    I have no idea why it would prompt "pick a point' twice. 

  • Works with 9.3.13 English as well

  • I upgared my program to 9.3.14 Polish and it works fine now.

    Thank You for Your support.

    wojtek

This discussion has been closed.