commands in slide-menu?

I have made a button with this code: ^C^C-INSERT $M=$(if,$(=,$(getvar,useri2),90),S01-01R,S01-01) \1 1 0

If useri2=90, it will insert S01-01R.dwg. If useri2 is not 90, it will insert S01-01.dwg.

This work 100% correct, but when I use the same code in a slide-menu it will not work.

The slide-menu is also working vey well because it work with all others commands I have tryed.

This is what happen when I run the code from the slide-menu:

: -INSERT
? to list blocks in drawing/~ to open the file dialog/<Block to insert> <S01-01R>: $M=$(if,$(=,$(getvar,useri2),90),S01-01R,S01-01)
-- Could not find file $(if,$(=,$(getvar,useri2),90),S01-01R,S01-01). --

So my question is: What is wrong? Any idea?

Comments

  • Slide Menu... Wow! Great tip!

    Slide Menu... I had never heard of it. Looking around I found an example and I have tested your code and it seems that BC is unable to handle DIESEL inside a Slide Menu.
    Lisp to the rescue! I have created a small lisp funtion to solve this problem. Just add the code to your on_doc_load.lsp. And modify your menu as explainded.

    ;;;  Made for: http://www.bricsys.nl/common/support/forumthread.jsp?id=12015
    ;;;
    ;;; Old Slide Menu entry:
    ;;; ^C^C-INSERT $M=$(if,$(=,$(getvar,useri2),90),S01-01R,S01-01) \1 1 0
    ;;; New Slide Menu entry examples:
    ;;; If you want the user to supply the insertion point only:
    ;;; ^C^C(InsertSelect "S01-01R" "S01-01" nil 1 1 1 0)
    ;;; If you want the user to supply the insertion point and the x, y and z scale:
    ;;; ^C^C(InsertSelect "S01-01R" "S01-01" nil nil nil nil 0)
    ;;; If you want the user to supply the insertion point and the angle:
    ;;; ^C^C(InsertSelect "S01-01R" "S01-01" nil 1 1 1 nil)
    ;;; If you don't want any user input:
    ;;; ^C^C(InsertSelect "S01-01R" "S01-01" '(0 0 0) 1 1 1 0)

    (defun InsertSelect (i2Is90Block i2Not90Block ins x y z rotation)
    (command
    "_.-insert"
    (if (= (getvar "useri2") 90) i2Is90Block i2Not90Block)
    (if ins ins pause)
    "_xyz"
    (if x x pause)
    (if y y pause)
    (if z z pause)
    (if rotation rotation pause)
    )
    ; to handle attributes:
    (while (> (getvar "cmdactive") 0) (command pause))
    (princ)
    )
    For others who are interested in Slide Menus:
    Visit this link: http://forums.mrplc.com/index.php?autocom=downloads&showfile=146
    Download the file and put all the dwg's and slides in a folder that is in the search path.
    Because BC doesn't support slide libraries it is necessary to edit the menu file.
    Open the mnu file in a plain text editor and change all occurances of:
    [schem(
    to:
    [(
    And all occurances of:
    [panel(
    to:
    [(
    Start BC and load the edited menu as a partial CUI.
  • I have done as you suggest here, and now it is working very well.

    THANK YOU very much.

This discussion has been closed.