+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default about load CUI file

    Hi all,
    I have a CUI file include toolbar and menu with name mycuifile.cui, when i use a scrip file with command
    (command "_menuload" "C:\\mycuifile.cui")
    Autocad load toolbar only, it can't load menu
    why?
    thanks for support!

  2. #2
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    (command "_cuiload" "C:\\mycuifile.cui")

  3. #3
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default

    thanks but it can't load menu, too.
    But when i type (command "_menuload" "C:\\mycuifile.cui") in command line, it work correct
    Autocad load toolbar and menu
    Last edited by thanhhuynh; 21st Aug 2008 at 03:57 am.

  4. #4
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    you may try this one.

    Code:
    (defun c:loadit	(/ cui_database mnbar flag)
      (vl-load-com)
      (setq	cui_database
    	 (list
    	   "EXPRESS"			;<<< MENUGROUP
    	   "C:\\Documents and Settings\\Ronald\\Application Data\\Autodesk\\AutoCAD 2008\\R17.1\\enu\\support\\acetmain.cui" ;<<<PATH & CUI FILENAME
    	   "E&xpress"			;<<< MENUNAME	 
    ) ;_ end_list
      ) ;_ end_setq
      (vlax-for n
    	      (setq all_menus
    		     (vla-get-MenuGroups
    		       (vlax-get-Acad-Object)
    		     ) ;_ end_vla-get-MenuGroups
    	      ) ;_ end_setq
        (if	(= (vla-get-name n) (car cui_database))
          (setq flag T)
        ) ;_ end_if
      ) ;_ end_vlax-for
      (if (null flag)
        (progn
          (vla-load
    	all_menus
    	(cadr cui_database)
          ) ;_ end_vla-load
          (setq MnBar
    	     (vla-get-MenuBar
    	       (vlax-get-Acad-Object)
    	     ) ;_ end_vla-get-MenuBar
          ) ;_ end_setq
          (vla-InsertInMenuBar
    	(vla-Item
    	  (vla-get-Menus
    	    (vla-Item
    	      (vla-get-MenuGroups
    		(vlax-get-Acad-Object)
    	      ) ;_ end_vla-get-MenuGroups
    	      (car cui_database)
    	    ) ;_ end_vla-Item
    	  ) ;_ end_vla-get-Menus
    	  (caddr cui_database)
    	) ;_ end_vla-Item
    	(1- (vla-get-Count MnBar))
          ) ;_ end_vla-InsertInMenuBar
        ) ;_ end_progn
        (princ "\n>>..MENU IS ALREADY LOADED..<<")
      ) ;_ end_if
      (princ)
    ) ;_ end_defun

  5. #5
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default

    Thanks for your support, it work correctly. But I want to use scrip file to add my menu and toolbar in Cad on another PC. That cui file is a share file.

    Can you help me? Thanks!
    Last edited by thanhhuynh; 22nd Aug 2008 at 01:05 pm.

  6. #6
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    in your scr file, you may have this:

    ;;;Point the script to the location of the loadit.lsp
    (load "c:\\completepathhere\\loadit)

    ;;;then run
    (c:loadit)



    you may also need to add additional support paths for your menu to work correctly in another computer.

  7. #7
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default

    i think so, thanks for your support!
    Last edited by thanhhuynh; 23rd Aug 2008 at 11:07 am.

  8. #8
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default

    When i use command cuiunload in my scrip to unload my cui file, it's only unload menu and toolbar on screen. partial cui file in CUI interface is not unload. when i restart ACAD it show toolbar again. Why?
    Thanks for support.

  9. #9
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    try this:


    Code:
    (defun c:unloadit ()
    (vl-load-com)
    (vla-unload (vla-Item (vla-get-MenuGroups (vlax-get-Acad-Object)) "EXPRESS")) ;...<<< MENUGROUP 
    (princ)
    ) ;_ end_defun

  10. #10
    Junior Member
    Using
    AutoCAD 2010
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    11

    Default

    Registered forum members do not see this ad.

    Thanks, but it used like command "cuiunload" cui file in CUI dialog is still there

Similar Threads

  1. Anyway to Re-Load & Un-Load Xrefs by Picking?
    By pjb84 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 1st Aug 2007, 09:39 pm
  2. load
    By rookie37 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 25th Mar 2007, 11:45 pm
  3. Help!!! My default acad.mnl file doesn't auto load!
    By greg.wright1 in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 12th Feb 2007, 01:57 pm
  4. always load some linetypes
    By paotis in forum AutoCAD General
    Replies: 3
    Last Post: 27th Nov 2006, 07:47 am
  5. I want to load block from file [vba]
    By pefi in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 29th Aug 2006, 08:58 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts