Jump to content

help with this routine get error message


Recommended Posts

Posted

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)
)

 

Posted

I suppose you meant :

(setvar "CMDECHO" 0)

and

(setvar "CMDECHO" 1)

Posted

Also, try to change initial (defun c:pd like for ex. (defun c:ppdd

Posted

 

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)
)

 

Posted

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

Posted

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

Posted

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.

 

Posted

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

 

  • Like 1
Posted

Good info, thanks.

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...