Using Multiple command lisp with buttons

I have a lisp file that changes entities to 5 specific layers (see attached).

There are 5 layer changes in the one lisp that I use as keyboard shortcuts.

If I wanted to create 5 separate buttons to change the layers is there a way I can do this without splitting the routine into 5 separate lisps and assigning each one to a button?

Comments

  • Anthony Apostolaros
    edited November 2022
    I don't use buttons, but since no one else has answered... Aren't they just defined by a command and an image for each button? You've already got 5 different custom commands in your .lsp file. So don't you just need 5 images to go with them? 5 different images, I guess, but maybe only if you need that to tell them apart. I have no idea how to create and assign button images, but it looks like there's a video tutorial on it: https://www.youtube.com/watch?v=JV2RCA9jpzc
  • Making a toolbar is the easiest I would suggest make a custom toolbar this way you do not screw up the default toolbars.

    ***MENUGROUP=ALANSTOOLBAR
    ***TOOLBARS
    **ALANSTOOLS
    ID_ALAN_1 [_Toolbar("Alans2", _LEFT, _Show, 50,50, 1)]
    CL [_Button("Draw Cl", CL.BMP, CL.BMP)]^C^C^C-la s Design-Cl line;
    Lip [_Button("Draw Lip", LIP.BMP, LIP.BMP)]^C^C^C-la s Design-Lip line;

    So you can see how the icons are added.

    Software like paint.net allow you to draw bitmaps at the 16x16 or 32x32 level.

    I need to redo these.

    A hint open CUI and you can look at the icons cut and paste the icon names to your menu if you want to use some of the inbuilt ones there are hundreds.
  • Thanks for the replies Anthony & Alan, I was away after asking so couldn't try anything.

    It is all sorted as I had forgotten you used the XXX after defun c: as the command name and not the name of the lisp.

    So I just used each separate command within the lisp on each button and it works perfectly.

    @ALANH, I have this as part of a partial CUI so no fear of ruining my default menus.

    Thanks again.