Jump to content

Updating menus from network drive


au-s

Recommended Posts

Hi!

 

I am wondering if it is possible and maybe how it can be done to update menus via lisp or other procedure.

For now in our office there are 70 people. They can reload menus on their own when I make a change in them or in a certain lisp.

How can I make the update beeing made from a network drive. All my lisp files and search paths are on a network drive.

 

Can I even make so if a user starts AutoCAD then the update file is beeing processed and if that user logs in again the update will not take effect.

What I had in mind maybe is to copy the file to local temp dir, execute the update and then delete the file.

 

That's too much for me to handle via lisp but if you ccan help me on the way, maybe you have something similar or maybe another better way to do it.

 

Best regards

Link to comment
Share on other sites

Maybe this will help you (placed in acaddoc.lsp):

 

(if (not (menugroup "UserMenu"))   ;check if user menu is loaded and load/display if not
(progn
 (if (<  (atof (getvar "ACADVER")) 16)                        ;versions above R2004
  (command "_MENULOAD" (strcat MyToolsPath "usermenu.mns"))   ;old format menus
  (command "_MENULOAD" (strcat MyToolsPath "usermenu.cui"))   ;Custom User Interface
 )
  (menucmd "p11=+USERMENU.POP1")                               ;display it as item 10
)
)

 

Regards,

Link to comment
Share on other sites

Maybe this will help you (placed in acaddoc.lsp):

 

(if (not (menugroup "UserMenu"))   ;check if user menu is loaded and load/display if not
(progn
 (if (<  (atof (getvar "ACADVER")) 16)                        ;versions above R2004
  (command "_MENULOAD" (strcat MyToolsPath "usermenu.mns"))   ;old format menus
  (command "_MENULOAD" (strcat MyToolsPath "usermenu.cui"))   ;Custom User Interface
 )
  (menucmd "p11=+USERMENU.POP1")                               ;display it as item 10
)
)

 

Regards,

 

 

That checks if the menugroupios loaded, but if it is not it loads it.

Am I right?

 

Thing is I think that if I make a change to the lisp whith a command let say (command "DRAWCIRCLE") and I change that command in the lisp to (command "DRAWLINE") or I modify it will that update the menu to the changes I made?

 

I now have in my support file a lisp that is not in a acadoc.lsp. It has its own name under Support path.

In this lisp which is copied from afralisp I have this bit of code:

(setq flag1 T)
;check if the menu is not already loaded
(setq loaded (menugroup "AIX_Huvudmeny"))
;if it is not loaded
(if (= loaded nil)
  ;do the following
  (progn

;find the menu file
       (setq temp (findfile "AIX_Huvudmeny.mnu"))
   ;if you find the menu
          (if temp
 ;do the following
    (progn
  ;switch off dialogues
  (setvar "FILEDIA" 0)
  ;load the menu
      (command "menuload" "AIX_Huvudmeny")
  ;switch on dialogues
  (setvar "FILEDIA" 1)
  ;install the pulldown
      (menucmd "P12=+AIX_Huvudmeny.pop01")
  ;inform the user
         (prompt "\nLaddar AIX_Huvudmeny....\n")
 );progn
 ;menu not find, so do the following
 (progn
  ;inform the user
                       (alert "Kunde ej hitta AIX_Huvudmeny. Kontakta Administratören.")
  ;clear the flag 
  (setq flag1 nil)
 );progn
   );if
   );progn
);if

 

Does that the same as your example?

Or is the trick to have a acadoc.lsp to run at startup and that will update my changes made to the lisp?

 

The main issue here is that I simply want the lisps and menus to be updated each time a user in an office start AutoCAD.

I might do some changes as I mentioned and now I have to unload menus and then reload them again for the changes to take effect.

 

Thanx for help.

 

Best Regards

Link to comment
Share on other sites

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