Cuiload works first time but then causes errror

Cuiload works first time but then causes errror

Anonymous
Not applicable
517 Views
3 Replies
Message 1 of 4

Cuiload works first time but then causes errror

Anonymous
Not applicable

Windows 7, AutoCAD Mechanical 2012

On the launch I run a LISP routine that has the line below. The toolbar menu comes in fine the first time but then on  the second launch I get this and I have to click esc to get it to cancel.

 

Enter name of customization file to load: my_toolbar.cuix my_toolbar.cuix
Enter name of customization file to load: nil

Enter name of customization file to load: *Cancel*

 

 

(command "cuiload" "My_toolbar.cuix")

 

I've tried an if statement but menugroup will return nil if the toolbar menu is there or if it is not there.


(IF (= nil (menugroup "my_toolbar"))(command "cuiload" "my_toolbar.cuix"))

 

I know I'm missing somthing simple

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

doglips
Advocate
Advocate
Accepted solution

Maybe soething like:

 

(if (not (menugroup "your_menu_name"))
  (COMMAND "CUILOAD" "your_menu_namre")
 );;if

Message 3 of 4

Anonymous
Not applicable

The solution worked. I had something similar but I just noticed a typo in my code.

 

Thanks for the help.

0 Likes
Message 4 of 4

doglips
Advocate
Advocate
Glad to be of help
0 Likes