Executing SendCommand via VB-based DLL

Discussion in 'AutoCAD' started by Maksim Sestic, Oct 18, 2004.

  1. Dear all,

    The problem I'm stuck with: I'm writing external DLL libraries with exposed methods/properties for manipulating ACAD 2002 via VBA and VLisp. Everything works fine, except one. When my DLL calls ThisDrawing.SendCommand it somehow gets out of synch with VLisp functions being run from ACAD - on the other hand, when the same function gets run from within VBA everything's in order. Here's a code snippet:

    (defun C:Test()
    (vl-load-com)
    (setq TCGLib (vlax-create-object "TCGLIB.ChartsClass"))
    ;;Method for creating A4 layout chart
    ;;It performs series of ThisDrawing.SendCommand sequences...
    (setq Result (vlax-invoke-method TCGLib 'CreateChart "Chart" "A4" "PORTRAIT"))
    ;;Following method validates previously created chart
    (vlax-invoke-method TCGLib 'ValidateChart "Chart")
    )

    What happens then? Well, method ValidateChart executes BEFORE the SendCommand sequence defined in CreateChart method... It seems that SendCommand buffer gets flushed immediatelly after the VLisp function's end. Is there any way to trick ACAD to implicitly flush buffer and immediately execute defined SendCommand sequences?

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Oct 18, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.