0

I have trouble with calling methods from lisp command in Autocad. I am using lisp file in Autocad. When I call the macro name from Autocad it calls the method twice instead of single time.

In My lisp file

(defun c:Export_N()
(setvar "cmdecho" 0)
(command "-vbarun" "Export_New")
(princ)
)

In calling lisp file form Autocad:

openMacro = "Export_N " & vbCr
Set newButton = NewToolbar.AddToolbarButton("", "Export", "Export", openMacro)

SmallBitmapName = AppPath & "\" & "Tool Icon\MReport.bmp"     
LargeBitmapName = AppPath & "\" & "Tool Icon\MReport.bmp"     
newButton.SetBitmaps SmallBitmapName, LargeBitmapName
Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Sivaperuman
  • 239
  • 1
  • 4
  • 21

1 Answers1

3

Your macro includes a space and a carriage return. The space enters the command, and the carriage return repeats the command. Remove one or the other to prevent the command from repeating.

Owen Wengerd
  • 1,628
  • 1
  • 11
  • 11