I'm trying to put a pack & go command under 1 button. I always use Pack & go to write to the same directory (H:\send_files). In a lisp: (defun cackgo () (command "-pack" "c" "n" "H:\send_files" "n" "n" "n") ) This is working fine, but when I put it under a button it doesn't work anymore. It's getting stuck at the directoryname I think. After completing the pack & go command I want to start windows explorer to look into the directory (H:\send_files). I use this under a button to open my workingdirectory, (startapp "EXPLORER" (strcat "/e," (getvar "DWGPREFIX"))) but when I alter this to (startapp "EXPLORER" (strcat "/e," "H:\send_files")) I get the same problem as the pack and go button. What am I doing wrong....... Laura
Hi Laura Change '\' to '\\'... (command "-pack" "c" "n" "H:\\send_files" "n" "n" "n") (startapp "EXPLORER" (strcat "/e," "H:\\send_files")) Cheers
Thanks Juerg, but it still gets stuck at the H: I get..... < Command: (command "-pack" "c" "n" "H: > Laura
Why not use eTransmit under File-->eTransmit But anyway, use for the backslash a double backslash becuase in the menu it used for input (pause) (defun cackgo () (command "-pack" "c" "n" "H:\\send_files" "n" "n" "n") )
Hi Zeha, Etransmit is also an option, and indeed a better one. I'm very lazy and want to do everything in one single mousclick My wish is that I save the drawing, including the xfiles (loaded ones) (AutoCAD Fonts, Shapes etc. don't have to be saved) And a text file with the listed xrefs. Zipped is also not necessary. But The double backslash is not working. I've tested it with a macrobutton with: (startapp "EXPLORER" (strcat "/e," "H:\\send_files")) But I stil get stuck at the Command: (command "-pack" "c" "n" "H: I've tried etransmit in a lisp, but also here I get still the directory failure. (defun c:transmit () (command "-etransmit" "folder" "H:\send_files" "" "n" "n" "n" "y") (princ) ) I've also tried this with the double slash, but still no result. Laura
(defun c:transmit () (command "-etransmit" "folder" "H:\send_files" "" "n" "n" "n" "y") (princ) ) Works okay here (AutoCad 2K4), but add another "n" or "y" for web page. (command "_etransmit" "f" "h:\send_files" "" "n" "n" "n" "y" "n") HTH
try this for the explorer (startapp "explorer /n,/e," "H:/send-files") or (startapp "explorer /n,/e," (getvar "dwgprefix")) form the current directory 'dwgprefix' for eTransmit (defun c:transmit (/ fname) (if (findfile (setq fname (strcat "H:/send_files/" (vl-filename-base (getvar "dwgname")) ".zip"))) (command "-etransmit" "Zip" fname "Yes" "" "Yes" "2000" "No" "Yes" "No" "") (command "-etransmit" "Zip" fname "" "Yes" "2000" "No" "Yes" "No" "") )) good luck
Thank you for all your trouble helping me. I realy really appreciate that. (startapp "explorer /n,/e," "H:/send-files") does not work under a button. I get the message "The path 'H:/send_files does not exist or is nog a directory" I've tried it with a few different existing directories but they all give a failure message. I've tried: "H:/send_files" "H:/send_files/" "H://send_files/" "H://send_files" "H:\send_files" "H:\\send_files" "H:\\send_files\" How can I put this in the lisp with E-transmit. Is that possible? Etransmit is working good. I've changed it that it doesn't make a zip file and transmits only the drawing and the xrefs. (defun c:transmit (/ fname) (setq CMDECHO-OLD (getvar "cmdecho")) (setvar "cmdecho" 0) (if (findfile (setq fname (strcat "C:/versturen/" (vl-filename-base (getvar "dwgname"))))) (command "-etransmit" "folder" "C:/versturen/" "no" "" "Yes" "2000" "No" "Yes" "No" "") (command "-etransmit" "folder" "C:/versturen/" "" "no" "2000" "No" "Yes" "No" "") ) (setvar "cmdecho" CMDECHO-OLD) (princ) ) But I get a echo of "Command: TRANSMIT Unknown command "TRANSMIT". Press F1 for help." How can I get rid of that? And a second question. When I do want to select a directory, but after that the lisp should continue as above. I don't think I'm going to use that, but I'm just curious how it's done in this lisp. greetings Laura
Startapp requires a backslash as path delimiter. Unfortunately you can't use backslashes in a menu button. Put the sequence in a LISP file and call this from the button. Did you load the LISP before?... and my suggestion to avoid error messages in case of existing files: (defun C:Transmit (/ CMDECHO-OLD) (setq CMDECHO-OLD (getvar "CMDECHO")) (setvar "CMDECHO" 0) (command "_-ETRANSMIT" "_FOL" "C:\\Temp\\Test" "" "_Yes" "2000" "_No" "_Yes" "_No" ) (while (= (logand (getvar "CMDACTIVE") 1) 1) (command "")) (setvar "CMDECHO" CMDECHO-OLD) (princ) ) LISP has no direct access to a 'Folder Dialog' you've to use 'getfiled' with a dummy name and strip the file name from return value... or you use VBA with the SHBrowseForFolder-API. Cheers
Jurg has right you can try this (startapp "explorer /n,/e," (strcat "H"(chr 92)"send-files")) (defun c:transmit (/ fname CMDECHO-OLD) (setq CMDECHO-OLD (getvar "cmdecho")) (setvar "cmdecho" 0) (command "-etransmit" "folder" "C:\\versturen\\" "" "Yes" "2000" "No" "Yes" "No") (while (= (logand (getvar "CMDACTIVE") 1) 1) (command "all")) (setvar "cmdecho" CMDECHO-OLD) (princ) ) cheers Harrie
Thank you both, I'm helped with this. Only starting the explorer still doesn't work. But that that's OK. It should be nice, but not realy a problem. I always can make a shortcut on my desktop Laura
sorry my mistake send-files --> send_files try it again (startapp "explorer /n,/e," (strcat "H"(chr 92)"send_files"))
Hi Laura Harrie, good solution with 'chr', this string works in my menu button: ^P(progn (startapp "explorer /n,/e," (strcat "H:"(chr 92)"send_files"))(princ)) Cheers
I had already seen that. And it still doesn't work. I get the alert that the directory doesn't excist. And I've tried it with a few other excisting directories. I've tried it within Lisp and under a button. Laura
THIS IS WORKING !!! many thanks..... But now i want to know why it's working. I understand most of it. What means (chr 92) and why do you need to combine them with strcat to work properly? Hope you don't mind me asking this. Laura
Hi Laura Welcome... ^P -> MENUECHO off (progn -> Wraps (startapp...) and (princ) together (startapp "explorer /n,/e," (strcat "H:" -> 'strcat' concatenate 'H:', value from 'chr' and 'send_files' (chr 92) -> returns a character by ASCII code (ASCII 92 = '\') "send_files") ) (princ) -> suppresses the return value of startapp ) No prob... Cheers