Jump to content

Recommended Posts

Posted

I found another thing that may be causing some trouble:

 

;
 ; -- Function MeLoadPartMenu
 ; Loading partial menus.
 ; Arguments [Type]:
 ;Grp = Menu group [sTR]
 ;Nme = Menu file name (w/o .ext) [sTR]
 ; Return [Type]:
 ; > True if file found [bOOLEAN]
 ; > Nil if not [bOOLEAN]
 ; Notes:
 ; - Already loaded menu remains
 ; - Consider changed menu file paths
 ;
(defun MeLoadPartMenu  (Grp Nme / AcaObj FilPth GrpCol MnuExt MnuLst)
 (setq AcaObj (vlax-get-acad-object)
       GrpCol (vla-get-MenuGroups AcaObj)
       MnuExt (if (< (atof (getvar "ACADVER")) 16.2) ".mnu" ".cui"))

 (vlax-for Obj  GrpCol
   (setq FilPth (strcase (vla-get-MenuFileName Obj))
         MnuLst (cons
                  (strcat
                    (vl-filename-directory FilPth) "\\"
                    (vl-filename-base FilPth))
                  MnuLst))
   (vlax-release-object Obj))
 
 (if (or
       (setq FilPth (findfile (strcat Nme MnuExt)))
       (setq FilPth (findfile (strcat Nme ".mnu"))))
   (progn
     (setq FilPth (strcat
                    (vl-filename-directory FilPth) "\\"
                    (vl-filename-base FilPth)))
     (if (menugroup Grp)
       (if (not (member (strcase FilPth) MnuLst))
         (progn
           ([b][color=Red]MeUnloadPartMenu[/color][/b] Grp)
           (vla-load (vla-get-MenuGroups AcaObj) Nme)))
       (vla-load GrpCol Nme))
     T)
   (alert
     (strcat
       "Menu file '" Nme MnuExt "/.mnu' not found." "\nCheck your installation please."))))

 ; -- Function MeUnloadPartMenu
 ; Unload a partial menu.
 ; Arguments [Type]:
 ; Grp = Menu group name [sTR]
 ; Return [Type]:
 ; > Null
 ; Notes:
 ; None

(defun [b][color=Red]MeUnloadPartMenu[/color][/b]  (Grp)
 (vlax-for Obj  (vla-get-MenuGroups (vlax-get-acad-object))
   (if (eq (vla-get-Name Obj) Grp)
     (vla-unload Obj))
   (vlax-release-object Obj))
 (princ))

(defun c:test ()
 (MeLoadPartMenu "options" "options")
 (princ))

 

If that indeed is the sub-function to be called, it was incorrectly specified in the old code.

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • MarcoW

    12

  • wizman

    5

  • Lee Mac

    4

  • rkmcswain

    3

Top Posters In This Topic

Posted

Still the same...

 

Im tired of it, gonna go sporting now.

 

Ill try later again. Thank you very much for your help !!

 

In the meantime I have several new ideas, if you are ready for it, let me know. I will take care of all of you guys not to be bored.

 

:)

Posted

Well, nobody ? No ideas ?

  • 2 weeks later...
Posted

I can't help it but this one bothers me... still. Can't sleep at night:geek: ... feel horrible... :?

 

Today I found a lisp routine in zip file that worked for a short period of time: http://www.afralisp.net/zip/vbamenu1.zip

 

First loaded the lisp routine I then activated by command "vbamenu".

It prompted for the menuname so I gave "tools" for that was my latest creation... and YES it loaded and it was VISIBLE !!!

There was no unloadfunction so I "menuunloaded" the whole thing maually. It was gone... Reload worked and so on... Great I thought...

 

After a little bit of playing with the other files (the actual VBA menu witch do not have my interest) it only works with the VBA menu. I mean i can't load "tools" again.

 

Allthoug I am quite %#$@ with the hole thing, I know that there is something in the lisp file that does what I want. For thos who forgot: i want to be able to load and unload a menu by toggle. (A pull downmenu if you like). With macro ^C^Cmenuload;tools; it works but it is not visible.

 

So... who of the you LispGiants help me out... How to modify the given lisp routine so it wil load a menu that i specify?

 

Since this is a long threat I can PM if u like...

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