Jump to content

Recommended Posts

Posted

Hi All,

 

My Request is how can I load menu file automatically through lisp. I've already made a lisp which add support path to the folder which contains lisp routines and want to add code to autoload menu files.

 

Any help would be appreciated.

 

Thanks and Regards

Aaryan

Posted

Thanks a Lot.

 

It is successfully loaded.

But why cant i see the toolbar. Here is what i tried.

I am also getting a message that 'toolbar not found'

 

As a link provided asos2000

(defun PlaceCCMenu  (/ CNT)
 (setq CNT 1)
 (while (< CNT 24)
   (if (menucmd (strcat "P" (itoa CNT) ".1=?"))
     (setq CNT (1+ CNT))
     (progn (if (> CNT 2)
              (setq CNT (1- CNT))
              (setq CNT 2))
            (menucmd (strcat "p" (itoa CNT) "=+CC.POP1"))
            (setq CNT 25)))))
(defun CChart  (/ ProgLoad CCPath)
 (setq CCPath "C:\\Program Files\\CC\\CC.01\\")
 (cond ((< (distof (substr (getvar "acadver") 1 4)) 16.0)
        (setq ProgLoad (strcat CCPath "CC.mnc")))
       ((and (>= (distof (substr (getvar "acadver") 1 4)) 16.0)
             (< (distof (substr (getvar "acadver") 1 4)) 16.2))
        (setq ProgLoad (findfile (strcat CCPath "CC.mnc"))))
;;;     
       ((and (>= (distof (substr (getvar "acadver") 1 4)) 16.2)
             (< (distof (substr (getvar "acadver") 1 4)) 17.0))
        (setq ProgLoad (findfile (strcat CCPath "CC.cui"))))
;;;
       ((and (>= (distof (substr (getvar "acadver") 1 4)) 17.0)
             (< (distof (substr (getvar "acadver") 1 4)) 18.0))
        (setq ProgLoad (findfile (strcat CCPath "CC.cui"))))
;;;
       ((and (>= (distof (substr (getvar "acadver") 1 4)) 18.0)
             (< (distof (substr (getvar "acadver") 1 4)) 19.0))
        (setq ProgLoad (findfile (strcat CCPath "CC.cui")))))
 (cond
   ((/= ProgLoad nil)
    (progn (command "menuunload" "CC" "menuload" ProgLoad)
           (PlaceCCMenu)
           (command "toolbar" "CC" "float" "800,52" "1")
           (princ "\n*** ---------- CC Menu Loaded ---------- ***")))
   ((= ProgLoad nil)
    (alert "CC Program is Not Loaded!")))
 (princ))

 

Next Mircea's code edited.

(setq MyToolsPath "C:\\Program Files\\CC\\CC.01\\")
(setq Menu_Name "CC")
(setq Group_Name "CC")
(if (not (menugroup Group_Name))   ;check if user menu is loaded and load/display if not
(progn
 (if (<  (atof (getvar "ACADVER")) 16)                        ;versions above R2004
  (command "_MENULOAD" (strcat MyToolsPath "CC" ".mns"))   ;.mns file
  (command "_MENULOAD" (strcat MyToolsPath "CC" ".mnu"))   ;.mnu file
 )
  (menucmd "p11=+CC.POP1")                               ;display it as item 10
)
(princ))

 

Please Help

Posted

I believe that menu file format for AutoCAD 2007 should be CUI and for 2010 and above, CUIX.

Posted

thanks i got it... Mircea

One more thing, I cannot see the menu beside 'help'. what could it be...

 

 

Regards

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