cyberactive Posted April 28, 2023 Posted April 28, 2023 I have this routine, it works fine but the problem is that when loading for the second time I get an error that says: file already loaded "program path" 2023\support\pd.dvb, of course it's not much of a problem because you click accept and The program loads normally. Is there a way to add it to the route so that it can load as many times as possible without getting that error?. (defun c:pd () (setvar "CpdECHO" 0) (if (findfile "pd.dvb") (progn (setvar "FILEDIA" 0) (command "vbaload" (findfile "pd.dvb")) (command "-VBARUN" "Module1.pd") ;load module pd (command "_vbaunload") (setvar "FILEDIA" 1) ) (princ "\nThere is no pd project") ) (setvar "CpdECHO" 1) (princ) ) Quote
marko_ribar Posted April 28, 2023 Posted April 28, 2023 I suppose you meant : (setvar "CMDECHO" 0) and (setvar "CMDECHO" 1) Quote
marko_ribar Posted April 28, 2023 Posted April 28, 2023 Also, try to change initial (defun c:pd like for ex. (defun c:ppdd Quote
cyberactive Posted April 28, 2023 Author Posted April 28, 2023 Yes it is true I got confused when writing and just copied but not even with that, the error continues, the routine works the problem is the message that comes out when you start loading from the second time (defun c:pd () (setvar "CMDECHO" 0) (if (findfile "pd.dvb") (progn (setvar "FILEDIA" 0) (command "vbaload" (findfile "pd.dvb")) (command "-VBARUN" "Module1.pd") ;load module pd (command "_vbaunload") (setvar "FILEDIA" 1) ) (princ "\nThere is no pd project") ) (setvar "CMDECHO" 1) (princ) ) Quote
Steven P Posted April 28, 2023 Posted April 28, 2023 Does this create the message vl-vbaload Not saying it is an error, just a message - it is doing as it should Then you can also have vl-vbarun Not something i have ever used but these look to be alternative commands Quote
cyberactive Posted April 28, 2023 Author Posted April 28, 2023 I understand it is normal for this message to appear but what I need is for it not to appear, after the second load, it finally loads the application but with that detail after a second load, I know there is a way to control it Quote
cyberactive Posted April 28, 2023 Author Posted April 28, 2023 Solved, I just added this function and I was left without problems: (vl-vbaload (findfile "pd.dvb")), in any case, thank you very much if it helps, that was the solution. Quote
BIGAL Posted April 29, 2023 Posted April 29, 2023 In lisp can check is function loaded if not then load a lisp. Not sure if same for a VBA function. Your vba should have function names, so maybe try this. Load your VBA then try this let me know. (if (not yourvbafunctionname) (alert "vba not found ") (alert "vba found") ; if true already loaded this message will appear ) same in lisp (if (not AH:getvalsm)(load "Multi Getvals.lsp")) ; looks for function AH:getvalsm if not exist then load the lisp 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.