Results 1 to 7 of 7

Thread: Adding custom Pop Menu via code to the menu bar.

  1. #1
    Member
    Join Date
    2006-06
    Posts
    7
    Login to Give a bone
    0

    Default Adding custom Pop Menu via code to the menu bar.

    I wrote Lisp code which will execute from acad2006doc.lsp and check to see if a certain Popup Menu (defined in a partial CUI file) is displayed in the current menu bar. If not, I manipulate the object model classes MenuBar and MenuGroups (and their sub-classes) to display it. The code works fine, but what I noticed is that the Customer User Interface does not register these changes I made through the object model. I can see my partial CUI in the CUI screen, but the popup menu is not check to indicate that it is being displayed. I'm concerned with the fact that the CUI is "out of synch" and that this may cause problems further down the line when users start feeling comfortable with manipulating the CUI themselves. Any thoughts?

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    Why not simply use a workspace? I used to do such swapping pre-CUI, but went to workspaces with the CUI.

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    Ditto Robert, and another note, any custom code should really be in "acaddoc.lsp", not "acad200xdoc.lsp"
    R.K. McSwain | CAD Panacea |

  4. #4
    Member
    Join Date
    2006-06
    Posts
    7
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    I looked at the workspace command but could not figure out how to add a menu to the current workspace from a lisp program. This code has to run without any actions from the user and the only way I know how to edit a workspace is through the CUI screen.

  5. #5
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    Are you doing this as an internal app in-house, or are you attempting to create an installer package for other firms to use your app?

  6. #6
    Member
    Join Date
    2006-06
    Posts
    7
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    Installer package for other firms.

  7. #7
    Login to Give a bone
    0

    Default Re: Adding custom Pop Menu via code to the menu bar.

    Quote Originally Posted by dfe
    I wrote Lisp code which will execute from acad2006doc.lsp and check to see if a certain Popup Menu (defined in a partial CUI file) is displayed in the current menu bar. If not, I manipulate the object model classes MenuBar and MenuGroups (and their sub-classes) to display it. The code works fine, but what I noticed is that the Customer User Interface does not register these changes I made through the object model. I can see my partial CUI in the CUI screen, but the popup menu is not check to indicate that it is being displayed. I'm concerned with the fact that the CUI is "out of synch" and that this may cause problems further down the line when users start feeling comfortable with manipulating the CUI themselves. Any thoughts?
    For anyone reviewing this thread...

    In lisp add the following:
    (setq currws (getvar "wscurrent"))
    (if currws (command "workspace" "saveas" currws "yes"))

    It's a trick that I do with profiles as well. Saving the current workspace will update it with current settings.

Similar Threads

  1. 2014: Creating Custom Pull-Down Menu With Custom Blocks
    By CSIMS in forum AutoCAD CUI Menus
    Replies: 7
    Last Post: 2015-02-23, 05:53 PM
  2. Adding a new INSERT COMPONENT menu Item.
    By hollenbeck in forum AutoCAD Electrical - General
    Replies: 3
    Last Post: 2008-05-07, 08:23 PM
  3. adding accelerator keys to acad menu
    By rond056 in forum AutoCAD CUI Menus
    Replies: 2
    Last Post: 2007-12-22, 01:00 AM
  4. How to write new menu file or update the existing menu in AutoCAD 2006
    By Partha Ghosh in forum CAD Management - General
    Replies: 1
    Last Post: 2007-09-30, 01:45 PM
  5. Replies: 2
    Last Post: 2007-02-07, 06:13 PM

Posting Permissions

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