TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: pmvliet on December 16, 2004, 04:51:40 PM
-
Hi Everyone,
can you set a variable
(setq client "riteaid")
and then have "client" be in a path such as
"i:\\standards\\retail\\_$ client\\_$ client.bat"
I tried putting _$ client in () but that didn't help either.
the path really should be
i:\\standards\\retail\\riteaid\\riteaid.bat
thanks, I am slowly trying to learn this.
The reason is I am trying to load and un-load menu's but the menu that is being unloaded may not always be the same one. I was thinking if I could have the menu name as a constant variable, that would be one way around it. Here is the code that I am working with.
(defun c:riteaid ()
(startapp "i:\\standards\\retail\\riteaid\\riteaid.bat")
(command "menuload"
"i:\\standards\\retail\\riteaid\\menu\\riteaid"
)
(menucmd "p1=+acad.pop1")
(menucmd "p16=+riteaid.pop1")
(alert "Notice:\nThe riteaid Workspace has been loaded!")
)
I am trying to pull in a menu, then load a pulldown. But then I want to remove the menu replace it with another one and then load that pop menu.
TIA
Pieter
-
Use 'strcat' i.e.
(strcat "i:\\standards\\retail\\"client"\\"client".bat")
-
6 minutes Mark!
You are quick.
I gota read how that works. Thanks for the heads up.
Pieter
-
What is the bat file loading?
Can you post the bat file?
Right off hand I would say you could use strcat to do what I think you want.
-
Dang MARK!!!!! :(
:D :D :D :D :D
It's about time you beat me.
-
Dang MARK!!!!! :(
nanananana ............. *grin*
-
--||thssssttttt||--
:lol:
-
Ok, I read what stract and it says this is something that "string concatenates" or combines whatever follows into a single string.
so if I add this (what mark said)
(strcat "i:\\standards\\retail\\"client"\\"client".bat")
is it defining strcat to be i:\standards\retail\riteaid\riteaid.bat
so does it evaluate the variable client into the process?
If it does define strcat to the above, how do I call this?
I guess I am confused on how to incorporate this with my startapp
line of
(startapp "i:\\standards\\retail\\riteaid\\riteaid.bat")
THis is what I have now
(defun c:riteaid (/ client)
(setq client "riteaid")
(startapp
(strcat "i:\\standards\\retail\\"client"\\"client".bat")
)
(command "menuload"
(strcat "i:\\standards\\retail\\"client"\\menu\\"client")
)
(menucmd "p16=-(_$ client).pop1")
(
(menucmd "p16=+(_$ client).pop1")
(alert "Notice:\nThe riteaid Workspace has been loaded!")
)
)
-
If you want to see what my batch file is doing, this is it
:1
if exist c:\Autocad goto 2
md c:\AutoCad
md c:\AutoCad\Autosave
md c:\AutoCad\BAK
md c:\AutoCad\Fonts
md c:\AutoCad\Linetype
md "c:\AutoCad\Plot Styles"
md c:\AutoCad\Plotters
md c:\AutoCad\Temp
md c:\AutoCad\Textures
:2
del /q "c:\autocad\fonts\*.*"
del /q "c:\autocad\linetype\*.*"
del /q "c:\autocad\Plot styles\*.*"
del /q "c:\autocad\textures\*.*"
copy "i:\standards\retail\riteaid\font\*.*" "c:\autocad\fonts\*.*"
copy "i:\standards\retail\riteaid\Plot styles\*.*" "c:\autocad\Plot styles\*.*"
Basically this is a archaic/crude way to get rid of different AutoCad Profiles. We need the profiles for search paths, colortables, fonts, plotters etc. I just don't like that my users have to keep switching profiles to work on another client.
And for those that are asking: I have used them for 3 years now. We have an excess of 25-30 different profiles for all different clients. I am trying to take it a step further so I don't have to keep disturbing the users.
Pieter
-
this is my best guess.
(defun c:riteaid (/ client)
(setq client "riteaid")
(startapp
(strcat "i:\\standards\\retail\\" client "\\" client ".bat")
)
(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!")
)
)
-
Thanks Mark,
that is a step closer. Still having issues with loading and unloading menu's
and also the pull downs. I need to set some time to play with it.
The variable works pretty neat.
I am also getting a ; error: no function definition: nil
once it loads so i need to track that down.
Also need to look into if then statements so tat the code and check existing conditions.
Thanks,
Pieter