rob150588 Posted January 7, 2011 Posted January 7, 2011 Afternoon. I've got a little problem trying to make a menu command to load a partial customisation file. I've created ths macro: ^C^C_filedia;0;menuload;N:/CAD/2D/blahblahblah.cuix;filedia;1; ...which seems to run fine and loads the CUI, but the popdown menu defined herein will not display on the menubar. I've also tried the same thing in LiSP: (command "filedia" "0" "menuload" "N:/CAD/2D/blahblahblah.cuix" "filedia" "1") ...but with the same result. When typing the commands in manually one-by-one it displays fine. It's just when I try to automate it it fails. Does anybody have any bright ideas how to fix this ? Cheers. Rob. Quote
rkmcswain Posted January 7, 2011 Posted January 7, 2011 AFAIK, the results you are getting are to be expected. I have a lisp routine that loads various pull-downs from multiple CUI files, and it loads the menu AND there is additional code to place the menu in the menu bar (to make it visible). Quote
rob150588 Posted January 7, 2011 Author Posted January 7, 2011 Thanks for your reply. Is this code readily available to make the pulldown visible ? Also, is there actually a reason why this happens...or is it just another "Autodesk-ism" ? Cheers. Rob. Quote
rkmcswain Posted January 7, 2011 Posted January 7, 2011 Well, I assume that the dialog version of MENULOAD, does the loading for you, and always puts the pull down at the far right end. Using code allows you to place the pulldown wherever you want. It's not that difficult - but you will have to use lisp and the ActiveX object model. So basically, load the menu first like you are doing (other than you'll need an object reference to it), then use (vla-InsertInMenuBar) to make it visible. ActiveX Object Model: http://www.afralisp.net/reference/autocad-object-model.php Quote
rob150588 Posted January 7, 2011 Author Posted January 7, 2011 Thanks for that. Lisp programming was never my stong point. I'll see what I can do with that...but you'll probably hear from me again in the near future when I've knackered it ! Cheers. Rob. Quote
rkmcswain Posted January 7, 2011 Posted January 7, 2011 Yea, if you need more help, post back. I can't copy/paste the actual code here (it's not mine), but I point you in the right direction if you get stuck... The Afralisp link has good stuff also, as well as the VL Developers Bible.... http://cadpanacea.com/node/111 Quote
rob150588 Posted January 10, 2011 Author Posted January 10, 2011 Morning, I've sorted it now. I've written the command into an external lisp file and used (if (not c:anotherlisp)(load "anotherlisp")(princ));anotherlisp; to load the external lisp and run it. For the same reasons as you I'll not paste the contents of that lisp file. Thanks a lot for you help and your links. One day I'll know what I'm doing ! Quote
Recommended Posts
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.