Author Topic: Running a lisp Command from VBA with a pause  (Read 4177 times)

0 Members and 1 Guest are viewing this topic.

metal_pro

  • Guest
Running a lisp Command from VBA with a pause
« on: June 24, 2010, 12:44:49 PM »
I have a lisp command that I use to insert blocks (either Dynamic or regular)
(C:BBREAK) it asks for an insertion point on a line, then block name, then if its a dynamic block whats the visibility parameter value. Then it inserts the block and breaks the line out based on an attribute value in the block.
Typical macro usage looks like this for a dynamic block EB020.dwg with visibility parameter "NO"
bbreak;\EB020;y;NO;

My problem is I would like to run this lisp program from a VBA program also.
I thought I could use ThisDrawing.SendCommand but how do I pause for user input of the insertion point on a line.

bsardeson

  • Guest
Re: Running a lisp Command from VBA with a pause
« Reply #1 on: December 27, 2010, 10:32:09 AM »

My problem is I would like to run this lisp program from a VBA program also.
I thought I could use ThisDrawing.SendCommand but how do I pause for user input of the insertion point on a line.


My suggestion would be to rewrite the entire LISP routine in VB/VBA

However, with slight modifications to your LISP you could  ... capture the user input prior to using the SendCommand.  Then enter your point data into the sendcommand line as exampled below.
Code: [Select]
   Dim returnPnt(1) As Variant
    returnPnt(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
    returnPnt(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
    ThisDrawing.SendCommand "line " & returnPnt(0)(0) & "," & returnPnt(0)(1) & "," & returnPnt(0)(2) & vbCr _
        & returnPnt(1)(0) & "," & returnPnt(1)(1) & "," & returnPnt(1)(2) & vbCr & vbCr