Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Using StartApp

jwright1962
Advocate

Using StartApp

jwright1962
Advocate
Advocate

For years I've used StartApp to start "explorer" and open a folder where I keep my collection of lisp files.   I've cut and pasted the same little code snippet out of the toolbar button from a prior version of Cadd I was using.  Now, the durn thing only starts "explorer" in "Documents"...   I pasted the same durn thing to the command line and it opens explorer in the root directory of the C drive...  Whiskey Tango...?  

 

This has worked for years...   

 

^C^C(startapp "explorer" "C:/lsp")

 

but now... it does not.

 

any help out there?   Thanks Forum!!

0 Me gusta
Responder
Soluciones aceptadas (1)
2.241 Vistas
9 Respuestas
Respuestas (9)

TheCADnoob
Mentor
Mentor

try

 

^C^C(startapp "explorer" "C:\\lsp")

CADnoob

EESignature

0 Me gusta

paullimapa
Mentor
Mentor

You can also try this passing a number explorer command line parameters all in one shot:

 

(startapp "explorer.exe /n,/e,/select,c:\\lsp")

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Me gusta

jwright1962
Advocate
Advocate

Thanks to both previous replys.  I've tried both but neither work.   I've tried every combination I can think of with forward slash, back slash, no slash. but nothing seems to work.

 

(startapp "explorer" "c:\\lsp")   This works on the command line only but not when pasting exactly the same in a toolbar button  

0 Me gusta

paullimapa
Mentor
Mentor
Solución aceptada

Try defining a new lisp command function like OpenLsp and then enter this new command in the Toolbar ie:

(defun C:OpenLsp () (startapp "explorer" "c:\\Lsp"))

 

Then in the Toolbar enter:

^C^COpenLsp

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

rkmcswain
Mentor
Mentor
@jwright1962 - what changed in between the time it was working and now?

I know it sounds silly, but have you rebooted the PC?
R.K. McSwain     | CADpanacea | on twitter

jwright1962
Advocate
Advocate

OK, I have it resolved.  

I'm not sure what changed but I've tried every combination I could think of ...  "to slash or not to slash".  What worked was creating a separate lisp in my "lsp" folder; adding that lisp file as an autoload in acaddoc.lsp and then calling the function in the button as suggested above...  OpenLsp   this worked fine.   I was hoping not to have to manage more lisp overhead to get it to work but it is what it is... and it works as suggested above.   Actually; not a big deal to manage the lisp files.   I have a "ton" of general "utility" lisp files I use quite frequently and it's nice to have a single click to bring up my lsp folder rather than clicking several times in Windows to get to that folder "outside" of cad.  

0 Me gusta

paullimapa
Mentor
Mentor

Glad this worked out for you...cheers!!!

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Me gusta

rkmcswain
Mentor
Mentor
BTW: I prefer using the method of @paullimapa because it's easy to quickly make a change to a lisp file, but getting into the CUI and editing and testing menu macros can be more time consuming. So you put the never changing pointer in the CUI and then edit the lisp definition. You can also use this with variables/arguments --- your menu macro could be (OpenLsp 1) to open your lisp folder, and (OpenLsp 2) to open the current drawing folder, etc.
R.K. McSwain     | CADpanacea | on twitter
0 Me gusta

jwright1962
Advocate
Advocate

@rkmcswain wrote:
You can also use this with variables/arguments --- your menu macro could be (OpenLsp 1) to open your lisp folder, and (OpenLsp 2) to open the current drawing folder, etc.

I'll think on this...  This is a good tip and I'm sure I'll have opportunity to use this method.  I bet if time allows, I could "thin out" the number of utilities I have because lots of them have similar code...just copied from one lsp to another.   Providing a "switch" or "parameter" as you suggest would likely reduce replicating the similar code over and over again.  Thanks.

0 Me gusta