-vbarun help

-vbarun help

Anonymous
Not applicable
1,574 Views
3 Replies
Message 1 of 4

-vbarun help

Anonymous
Not applicable

I am compiling a LISP routine to run a macro while invoking "-VBARUN". Here is what I have so far...

 

;----------------------

(DEFUN c:txtmrg ()
  (COMMAND "-VBALOAD"
    (getfiled "Select a DVB File" "c:/program files/ <AutoCAD installation directory>/support/" "dvb" 8))

   ;<invoke -VBARUN here using selected directory from getfiled>
  (SETVAR "nomutt" 0)
  (PRINC)
) ;end-defun

;----------------------

 

I can get it far enough to load the Macro directory into AutoCAD with this, but when I invoke -VBARUN and type in the file name "txtmrg.dvb" it does not recognize the file has been loaded. So...

 

1) What am I missing that it does not see the DVB file?

2) Is there a way to run this macro without needing the second dialog box (from "VBARUN" - no hyphen)?

0 Likes
Accepted solutions (1)
1,575 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Is it possible to call the dialog box by VLA prior to the code starting (then recall the result later in the code)?

http://www.afralisp.net/archive/vl/vl-dir.htm

0 Likes
Message 3 of 4

Anonymous
Not applicable

I've gotten it this far... but once "-VBARUN" is called, it does not recognize the ff1 call anymore and stops cold. Man Surprised

 

Update: It has to do with the file call... <<Directory located>> + "!RuntimeEvents.StyleMerge" added to the end.

example: C:\Users\user\Desktop\Autocad Lisp Routines\txtmrg\txtmrg.dvb!RuntimeEvents.StyleMerge

 

(DEFUN C:FOO ( / ff ff1 )
  (setq ff (getfiled "Select a DVB File" "c:/program files/ <AutoCAD installation directory>/support/" "dvb" 8)
        ff1 (findfile ff)
	)
  (COMMAND "-VBALOAD" ff1)
  (COMMAND "-VBARUN" ff1)
  (SETVAR "nomutt" 0)
  (PRINC)
);_ end-defun

 

0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution
(defun C:TXTMRG ()
(if
  (not txtmrg)
    (if
      (and
	(findfile "txtmrg.lsp")
	(findfile "txtmrg.bvd")
	)
      (load "txtmrg.lsp")
      (alert "Please load TXTMRG files into the directory:\n\nC:/program files/autodesk/autocad 2015/support")
      )
    )
  (alert "File loaded.")

  (SETVAR "nomutt" 1)
  (COMMAND "SECURELOAD" 0)
  (setq A (findfile "txtmrg.dvb"));; Start of code
  (setq B (strcat A "!RuntimeEvents.StyleMerge"))
  (COMMAND "-VBALOAD" A)
  (COMMAND "-VBARUN" B)
  (COMMAND "SECURELOAD" 1)
  (SETVAR "nomutt" 0)
  (PRINC)
  )
0 Likes