Author Topic: Another Menu question  (Read 9101 times)

0 Members and 1 Guest are viewing this topic.

pmvliet

  • Guest
Another Menu question
« on: January 28, 2005, 02:23:21 PM »
My menu saga continues but I am seeing the light at the end of the tunnel.

I have loaded all my main menu's and now I want to be able to load and unload client menu's.

in psuedo code as Mark would say:
I need to select a client from a menu pulldown which is easy.
This will then call to load a specific menu which I can do. I can then add this into the pulldown which I can do.

Now the part I don't get. When the user goes to select another client, how do I get AutoCad to know what the previous client menu was to unload?
Basically I want to do a swap from Client A to Client B or Client C.
Order cannot matter as any combination may occur.

Withe the help of Mark from a little while ago I have this
Code: [Select]
(defun c:riteaid ()
  (setq client "riteaid")
       (command
   "menuload"
   (strcat "i:\\standards\\retail\\" client "\\menu\\" client)
   )
  (menucmd (strcat "p16=-" client ".pop1"))
  (
   (menucmd (strcat "p16=+" client ".pop1"))
   (alert "Notice:\nThe riteaid Workspace has been loaded!")
   )


I need to re-organize it a little and test for the result of the variable client.
if client comes back nil, then it can go ahead and load the menu and set it in the pulldown. If client comes back with something other then nil, I need to unload that client menu, redefine client and then proceed.

Am I thinking on the right line or way off? Am I making this way too complicated?

Thanks,
pieter

pmvliet

  • Guest
Another Menu question
« Reply #1 on: January 28, 2005, 03:00:05 PM »
Here I got the first part and it works. :D
Code: [Select]

(if (not (getenv "client"))
  (progn
    (setenv "client" "Riteaid")
(command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" (getenv "client") "\\menu\\" (getenv "client") ))
(menucmd (strcat "p15=+" (getenv "client") ".pop1"))
(alert (strcat "Notice:\nThe" (getenv "client") "Workspace has been loaded!"))
  )
)


How do I get it to do something different if the return from client is not "nil" ?? Hmmm, back to all the functions...

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Another Menu question
« Reply #2 on: January 28, 2005, 03:25:14 PM »
Maybe this ............
Code: [Select]

(if (not (getenv "client"))
  (progn
    (setenv "client" "Riteaid")
    (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" (getenv "client") "\\menu\\" (getenv "client") ))
      (menucmd (strcat "p15=+" (getenv "client") ".pop1"))
         (alert (strcat "Notice:\nThe" (getenv "client") "Workspace has been loaded!"))
    )
; else "client" is T
(progn
 (do more stuff here)
 )
)
TheSwamp.org  (serving the CAD community since 2003)

pmvliet

  • Guest
Another Menu question
« Reply #3 on: January 28, 2005, 05:05:10 PM »
thanks mark.
I don't know when I will get back as it is a friday and on Monday/Tuesday I'll be in another office.

pmvliet

  • Guest
Another Menu question
« Reply #4 on: January 28, 2005, 09:27:16 PM »
I have it so that if it is not nil, it will then clear that menu and the set my variable "client" to nil. But I need it to start over, So I need a loop?

Code: [Select]

(if (not (getenv "client"))
  (progn
    (setenv "client" "lowes")
    (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" (getenv "client") "\\menu\\" (getenv "client") ))
      (menucmd (strcat "p15=+" (getenv "client") ".pop1"))
         (alert (strcat "Notice:\nThe" (getenv "client") "Workspace has been loaded!"))
    )
   ; else "client" is T
   (progn
     (command "menuunload" (strcat (getenv "client")))
(setenv "client" "")
     )


I am also thinking that I need several variables because at the end when I set client to "nil" I really need it to be "lowes" in this case... So I need to swap variables. I have it set to "nil" as one option. Another will be "current client" and then I will have the "new client". So this one variable has 3 different instances.

psuedo code:
if "client" is set to nil, load the client menu.
if "client" is set to a new client, I need to remove the current client and then load in the new client.

Hmm... This sure seems complicated but I really like what it is allowing me to do :D I should go home...

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #5 on: January 29, 2005, 12:59:51 AM »
You may benefit from the cond statement.
But I'm not sure where you are going with this.
Can you post a more complete pseudo code?
What did you mean by 'I need to loop'

Code: [Select]
(cond
  ((null client); "client" is set to nil
    (load the client menu)
  )
  ((= clent "New Client")
    (remove the current client)
    (load in the new clien)
  )
  ((= clent "Client A")
    (remove the current client)
    (load in client A)
  )
  ((= clent "Client B")
    (remove the current client)
    (load in client B)
  )
  (T
    (do default action?)
  )
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
Another Menu question
« Reply #6 on: January 31, 2005, 07:37:13 AM »
just a thought but could he not create a dcl that could have a load and unload column with all of your menus and load and unload whichever one you need. gotta run...

pmvliet

  • Guest
Another Menu question
« Reply #7 on: January 31, 2005, 09:33:57 AM »
Cab,

I am looking at a way to load specific client menu when choosen via a menu pulldown or any other user selection. Just using menu pulldowns as it is the most basic.

The user starts Autocad. Then they can select the client that they are going to be doing work for. When they select the client, colortables, search paths and other variables will be set for that client.
The user works for a while and after lunch they need to work for another client. When they go to select their new client, it needs to unload the previous client. Then it will load in the new client menu and set all the system variables that it needs.

Maybe I am making this more complicated??? I probably have 30 different clients all with specific needs, colortables etc. This is my way to eliminate the use of profiles and have more control over variables and other things.

ELOQUINTET, I like the DCL idea, but I still need the code to load and unload menu's.

Thanks guys!

Pieter

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Another Menu question
« Reply #8 on: January 31, 2005, 09:49:10 AM »
I think I'm starting to understand..............  :D

Well you're using a system variable already as in;
Code: [Select]
(setenv "client" "Riteaid")

So in your program you would read that variable unload the menu that is named (Riteaid in this case), then load the next menu and set the 'client' variable to that. I hope this is making sense!!
TheSwamp.org  (serving the CAD community since 2003)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #9 on: January 31, 2005, 10:13:09 AM »
Something like this?
Code: [Select]
;;  variable "newclient" is passed here with the new client name

(if (or (null newclient) (= newclient ""))
  (setq newclient "lowes") ; default client
)
       
;;  check for new client
(if (= (strcase newclient) (strcase (getenv "client")))
  (alert "\r Client already Loaded")
  ;; else load client
  (cond
    ((= (strcase newclient) "LOWES")
      (setenv "client" newclient)
      (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient ))
        (menucmd (strcat "p15=+" newclient ".pop1"))
          (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
    )
    ;;  repeat for other clients
    ((= (strcase newclient) "ABC") ; stay with upper case
      (setenv "client" newclient)
      (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient ))
        (menucmd (strcat "p15=+" newclient ".pop1"))
          (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
    )
   
   (t ; if newclient is not found
     (alert "\r Client data missing nothing Loaded")
   )
  )
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Anonymous

  • Guest
Another Menu question
« Reply #10 on: January 31, 2005, 10:19:21 AM »
mark, I think you are getting it. Or at least what I am striving for.

Cab, thanks for that. It's going to take me a little while to read through it and understand and try it out.

I will post back what I find when I can.

Thanks guys!

Pieter

pmvliet

  • Guest
Another Menu question
« Reply #11 on: January 31, 2005, 10:50:27 AM »
ok, that was me previously but my cookie or something wasn't set...

ok a sidebar question.
Cab you are setting the variable "newclient" with setq.
is there a benefit to use setq rather then creating an environment variable
such as (setenv "client") ??

should I make them all setq variables?

Thanks,
Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #12 on: January 31, 2005, 11:03:40 AM »
My though was this, That your menu choice wiould do this
(DO_MENU_CHANGE "lowes"); ONE FOR EACH MENU BUTTON

Code: [Select]
(defin do_menu_choice (newclient)
(if (or (null newclient) (= newclient ""))
  (setq newclient "lowes") ; default client
)
       
;;  check for new client
(if (= (strcase newclient) (strcase (getenv "client")))
  (alert "\r Client already Loaded")
  ;; else load client
  (cond
    ((= (strcase newclient) "LOWES")
      (setenv "client" newclient)
      (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient ))
        (menucmd (strcat "p15=+" newclient ".pop1"))
          (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
    )
    ;;  repeat for other clients
    ((= (strcase newclient) "ABC") ; stay with upper case
      (setenv "client" newclient)
      (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient ))
        (menucmd (strcat "p15=+" newclient ".pop1"))
          (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
    )
   
   (t ; if newclient is not found
     (alert "\r Client data missing nothing Loaded")
   )
  )
)
)


No setq.
If you use setq it is only valid for the current drawing.
If you change drawings it uses another variable of the sane name where as setenv is good
for all drawing in that session.
So you see my post was not meant to be the final solution but code to help you get there.
you would have to turn my code into  a lisp.

Perhaps if you posted you menu code for client changes we could get closer to your problem.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #13 on: January 31, 2005, 12:55:29 PM »
ok, I am having a hard time re-writing my psuedo code. here is a simple way I wrote down. There are issues but maybe it will help you guys understand.

So far I have two variables:
"client" is the existing loaded client. This could be nil or a specific client.
"newclient" is the newly selected client by the user

The user selects a pulldown menu and selects a client and which needs to set the variable "newclient"

We need to check if "newclient" equals "client"
Code: [Select]
(if (= (strcase newclient)(strcase (getenv "client")))
  (alert "\r Client already Loaded")
)

(I don't know that this will ever happen but that is fine)

then if "newclient" does not equal "client"
Code: [Select]

((/= newclient (strcase (getenv "client"))

we need to unload "client"
Code: [Select]

(command "menuunload" (strcat (getenv "client")))

then, pass the value of "newclient" to "client"
Code: [Select]

(setenv "client" "newclient")

then, we need to load "client"
Code: [Select]

(command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" (getenv "client") "\\menu\\" (getenv "client")))
  (menucmd (strcat "p15=+" (getenv "client") ".pop1"))
  (alert (strcat "Notice:\nThe" (getenv "client") "Workspace has been loaded!"))


As far as how I am calling this, that I am still working on. Right now I am defining this routine with the client name.
My menu looks like this right now.
Code: [Select]

[->Retail]
[Lowe's]^c^clowes;
[Circuit City]
[Riteaid]^c^criteaid;
[Walgreen's]
[Petsmart]
[Meijer]
[Albertsons]
[Tippmann]
[GE Fuel]
[Retail]
[Dominicks]
[Westfield-in]
[<-Westfield-out]


The lowes or riteaid calls the following
Code: [Select]

(defun c:LOWES ()
  (load "i:\\autodesk\\ro sbu\\retail\\lowes\\support\\LOWES.lsp")
)


The lowes lisp is

Code: [Select]

;;;This is to see how the new system works
;;;sets's newclient variable to lowes
(setq newclient "lowes")
;;;Check to see if the "newclient" is already loaded
(if (= (strcase newclient) (strcase (getenv "client")))
  (alert "\r Client already Loaded")
)
;;;Check to see if "newclient" does not equal "client"
;;;if is does, unnload "client" and re-define "client" to be "newclient"
(cond
  ((/= newclient (strcase (getenv "client")))
   ((progn (command "menuunload" (strcat (getenv "client")))
  (setenv "client" "newclient")
;;;Load in "client"
  (command "menuload" (strcat "i:\\autodesk\\ro sbu\\retail\\" (getenv "client") "\\menu\\" (getenv "client")))
  (menucmd (strcat "p15=+" (getenv "client") ".pop1"))
  (alert (strcat "Notice:\nThe" (getenv "client") "Workspace has been loaded!"))
;;;If client is not found, alert user
  (t
    (alert "\r Client Data not found")
  )
    )
   )
  )
)


i really want the routine to be called straight from the pulldown menu but for some reason
Code: [Select]
^c^c(load "i:\\autodesk\\ro sbu\\retail\\lowes\\support\\LOWES.lsp")
does not want to work


Maybe some of this will help you understand.
This also does not eliminate the setq as I think that really should be a setenv variable.

Thanks,
Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #14 on: January 31, 2005, 07:47:54 PM »
Try this, menu code

Code: [Select]
[->Retail]
         [Lowe's]^c^c^P(if (null menu_change) (load menu_change));(menu_change "lowes");
         [Circuit City]^c^c^P(if (null menu_change) (load menu_change));(menu_change "Circuit City");
         [Riteaid]^c^c^P(if (null menu_change) (load menu_change));(menu_change "Riteaid");
         [Walgreen's]^c^c^P(if (null menu_change) (load menu_change));(menu_change "Walgreen's");
         [Petsmart]^c^c^P(if (null menu_change) (load menu_change));(menu_change "Petsmart");
         [Meijer] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "Meijer");
         [Albertsons]^c^c^P(if (null menu_change) (load menu_change));(menu_change "Albertsons");
         [Tippmann] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "Tippmann");
         [GE Fuel] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "GE Fuel");
         [Retail] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "Retail");
         [Dominicks] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "Dominicks");
         [Westfield-in] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "Westfield-in");
         [<-Westfield-out] ^c^c^P(if (null menu_change) (load menu_change));(menu_change "<-Westfield-out");


Put this lisp in the ACAD search path
Code: [Select]
;;  Menu_change.lsp
(defun menu_change (newclient)
  (if (or (null newclient) (= newclient ""))
    (setq newclient "lowes") ; default client
  )

  ;;  check for new client
  (if (= (strcase newclient) (strcase (getenv "client")))
    (alert "\r Client already Loaded")
    ;; else load client
    (if (member (strcase newclient)
                (list
                  "LOWE'S"
                  "CIRCUIT CITY"
                  "RITEAID"
                  "WALGREEN'S"
                  "PETSMART"
                  "MEIJER"
                  "ALBERTSONS"
                  "TIPPMANN"
                  "GE FUEL"
                  "RETAIL"
                  "DOMINICKS"
                  "WESTFIELD-IN"
                  "<-WESTFIELD-OUT"
                ) ; list
        ); member
     (progn
        ;; Check / Unload existing menugroup
        (if (/= (menugroup (getenv "client")) nil)
           (command "_MENUUNLOAD" (getenv "client"))
        ); end if
        (setenv "client" newclient)
        (command "menuload"
                (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient))
        (menucmd (strcat "p15=+" newclient ".pop1"))
        (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
      ); progn
      (alert "\r Client data missing nothing Loaded")
    ); endif
  ); endif
); end defun


No error checking, path must exist.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #15 on: February 01, 2005, 08:33:09 AM »
Gee Cab,

I didn't mean for you to write the whole thing....
I will try it in a little while.
The only one thing I see that I really don't like is having the list
of clients. This is only one part ouf our client list. It is probably closer to 30.

hey, I will take what I can and make things work.

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #16 on: February 01, 2005, 10:42:04 AM »
Quote from: pmvliet
Gee Cab,

I didn't mean for you to write the whole thing....
I will try it in a little while.
The only one thing I see that I really don't like is having the list
of clients. This is only one part ouf our client list. It is probably closer to 30.

hey, I will take what I can and make things work.

Pieter

No problem, it's mostly cut and paste.
Why don't you like the list?
Are you doing more than loading a menu?
Idealy the client data should be in a text file so you would not have to update the lisp.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #17 on: February 02, 2005, 06:18:01 PM »
your last statement hit it on the head.
The fewer core files I need to modify when we get a new client the better.
That list will be long and if I made 1 mistake putting another client in, none of that will work.

I am going to try this now and see how it goes.
I really appreciate your help.

Pieter

pmvliet

  • Guest
Another Menu question
« Reply #18 on: February 02, 2005, 06:59:17 PM »
Ok Cab,

I get the following error
Quote
; error: no function definition: MENU_CHANGE


I did lsp, function and menu_change was not loaded.
Once I loaded it in, I get this error
Quote

Command:
; error: bad argument type: stringp nil


which means I got a () or a "" issue so I will start looking at the code.
checked that...

I wonder if it is what I have in the mnu, due to the length it wrapped and I wonder if I got something typed in wrong...

Code: [Select]
^c^c^p that does a double cancel and then toggles the menuecho

then
Code: [Select]
(if (null menu_change) (load menu_change))
this looks to see if "menu_change" is loaded, if it isn't it loads it.
Code: [Select]
(menu_change "lowes")
does this define menu_change as lowes?
I guess I don't see how it proceeds...

I re-did my menu part and put spaces between the ) ; (
and that made it do something more and comes back with two errors.
Code: [Select]
Command:  ; error: bad argument type: stringp nil

Command:
_HELP
Command:  HELP
Command:  ; error: no function definition: MENU_CHANGE


this is urting my brain on top of the day I had so I am going to take off and try to get some sleep.

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #19 on: February 02, 2005, 09:39:42 PM »
This
Code: [Select]
(menu_change "lowe's")
calls the lisp and passes the string "lowe's" to the routine.
The string is stored in the variable newclient.
Try this:
Code: [Select]
;;  Menu_change.lsp
(defun menu_change (newclient)
  (if (or (null newclient) (= newclient ""))
    (setq newclient "lowe's") ; default client
  )
  (if (null (getenv "client"))
    (setenv "client" "None Loaded")
  )
  ;;  check for new client
  (if (= (strcase newclient) (strcase (getenv "client")))
    (alert "\r Client already Loaded")
    ;; else load client
    (if (member (strcase newclient)
                (list
                  "LOWE'S"
                  "CIRCUIT CITY"
                  "RITEAID"
                  "WALGREEN'S"
                  "PETSMART"
                  "MEIJER"
                  "ALBERTSONS"
                  "TIPPMANN"
                  "GE FUEL"
                  "RETAIL"
                  "DOMINICKS"
                  "WESTFIELD-IN"
                  "<-WESTFIELD-OUT"
                ) ; list
        ); member
     (progn
        ;; Check / Unload existing menugroup
        (if (/= (menugroup (getenv "client")) nil)
           (command "_MENUUNLOAD" (getenv "client"))
        ); end if
        (setenv "client" newclient)
        (command "menuload"
                (strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient))
        (menucmd (strcat "p15=+" newclient ".pop1"))
        (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
      ); progn
      (alert "\r Client data missing nothing Loaded")
    ); endif
  ); endif
  (princ)
); end defun
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #20 on: February 04, 2005, 12:53:12 PM »
Hi Cab,

I did two things, I replaced the menu_change code to the second one and I took all the spaces out of my menu. Now it sort of worked, but Menu_change is not getting loaded into the drawing. If I manually appload menu_change.lsp, the routine works. I do have a bug so i have to sort that out and I need to get more clients set up to really test this.

Stay tuned.

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #21 on: February 04, 2005, 01:18:00 PM »
Pieter

Replace the LOAD command with APPLOAD

Code: [Select]
[Lowe's]^c^c^P(if (null menu_change) (appload menu_change));(menu_change "lowes");
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #22 on: February 04, 2005, 03:04:08 PM »
Thanks Cab, I will change that to appload.
I will say that this is really, really sweet and everything that I want!
Profiles will be gone and I will be  :D

I need to modify the routine because as I was testing it I realized I have two more variables that I need to account for.

The statement
Code: [Select]
(menu_change "lowes");
takes Lowes to the menu_change lisp correct
it is then read into menu_change lisp with this
Code: [Select]
(defun menu_change (newclient)
so menu_change is a holder for the value to pass it on to the routine?
to become the variable "newclient"
is this correct?

Now, can I pull in two more variables as well the same way?
Code: [Select]
(Menu_change division sbu "lowes" "Retail" "RO SBU")

the reason being is
Quote

strcat "i:\\autodesk\\ro sbu\\retail\\" newclient "\\menu\\" newclient))


"ro sbu" needs to vary
and "retail" would vary depending on the one above.

Quote
strcat i:\\autodesk\\" SBU "\\" Division "\\" newclient "\\menu\\" newclient


I sure got a lot of variables in this thing, but I think that will make it work better and stay broad enough...

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #23 on: February 04, 2005, 03:45:01 PM »
You could keep the data in the lisp like this.
Code: [Select]
;;  Menu_change.lsp
(defun menu_change (newclient / clist)
  (if (or (null newclient) (= newclient ""))
    (setq newclient "lowe's") ; default client
  )
  (if (null (getenv "client"))
    (setenv "client" "None Loaded")
  )
  ;;  check for new client
  (if (= (strcase newclient) (strcase (getenv "client")))
    (alert "\r Client already Loaded")
    ;; else load client
    (if (setq clist (assoc (strcase newclient)
                (list
           (list  "LOWE'S"             "ro sbu" "retail")
           (list  "CIRCUIT CITY"       "ro sbu" "retail")
           (list  "RITEAID"            "ro sbu" "retail")
           (list  "WALGREEN'S"         "ro sbu" "retail")
           (list  "PETSMART"           "ro sbu" "retail")
           (list  "MEIJER"             "ro sbu" "retail")
           (list  "ALBERTSONS"         "ro sbu" "retail")
           (list  "TIPPMANN"           "ro sbu" "retail")
           (list  "GE FUEL"            "ro sbu" "retail")
           (list  "RETAIL"             "ro sbu" "retail")
           (list  "DOMINICKS"          "ro sbu" "retail")
           (list  "WESTFIELD-IN"       "ro sbu" "retail")
           (list  "<-WESTFIELD-OUT"    "ro sbu" "retail")
                ) ; list
        ); assoc
     (progn
        ;; Check / Unload existing menugroup
        (if (/= (menugroup (getenv "client")) nil)
           (command "_MENUUNLOAD" (getenv "client"))
        ); end if
        (setenv "client" newclient)
        (command "menuload"
                (strcat "i:\\autodesk\\" (cadr clist) "\\"
                        (caddr clist) "\\" newclient "\\menu\\" newclient))
        (menucmd (strcat "p15=+" newclient ".pop1"))
        (alert (strcat "Notice:\nThe" newclient "Workspace has been loaded!"))
      ); progn
      (alert "\r Client data missing nothing Loaded")
    ); endif
  ); endif
); end defun
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #24 on: February 04, 2005, 06:52:15 PM »
Hi Cab,

The appload didn't work either. I added a call for that routine in my main mnl file. You think that is ok... What could I take out of
Code: [Select]
[Lowe's]^c^c^P(if (null menu_change) (appload menu_change));(menu_change "lowes");
can it just be
Code: [Select]
^c^c^p(menu_change "lowes")

the other thing,
Code: [Select]
(setq newclient "lowe's")
lowe's is embeded into this code, how could we change this? I don't know if that is why Lowe's won't load correctly. I would take a guess.

Well Thanks a lot Cab! I will have to buy you a cold one or two when we meet!

Pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #25 on: February 04, 2005, 08:41:56 PM »
This is all you need if menu_choice is already loaded.
Code: [Select]
^c^c^p(menu_change "lowes")
Nothing else is needed.

Is the Menu_Choice routine working?
Note, your example is inconsistant with the lisp data which is "lowe's" not "lowes"
Sounds like "Menu_Choice.lsp" in not in the ACAD search path.
If you enter (load "Menu_choice") at the command line it will load if in the path.
You should not have to change the menu file just ge the lisp in the path.
Move it to the ACAD root directory & try to load it.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #26 on: February 09, 2005, 05:02:36 PM »
Hey Cab,

I figured out why my menu command didn't work.
I needed:
Quote
(Load "Menu_Change")

The quotes, now it works just fine.

ok, after testing it works really well and now I see something I want to add. Yet another variable to pull yet another menu.
This time I want to pull discipline menu's.

I don't fully understand the lists. Any tips to expand the list or to put it in.
I would call the variable "discipline" of "disc" for short.

Thanks,
pieter

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Menu question
« Reply #27 on: February 09, 2005, 06:49:55 PM »
Missing the quotes, sorry I didn't see that. I should have. :oops:

Can you give an example of the new item?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

pmvliet

  • Guest
Another Menu question
« Reply #28 on: February 14, 2005, 09:00:23 AM »
Basically I want to have part of my pulldown menu which will look like this:
Quote

[->Select your Discipline]
[Architectural]
[Mechanica]
[Plumbing]
[Civil]
[Structural]
[Interiors]
[Electrical]


When you select one of your disciplines, it will then load a cooresponding menu. Just like the client menu's but one for a discipline. Once this menu is loaded, I will have blocks/lisps/data associated for that specific client.

For me thinking ahead, some clients already have sub menu's like this and I may want to unload or disable these master disciplines but I will worry about that later.

Thanks,
Pieter