leonucadomi Posted June 4, 2021 Posted June 4, 2021 please help with lsp routine that opens current drawing folder.... I tried this and it didn't work (defun c: fl () (startapp "explorer" (getvar "dwgprefix")) (princ) ) Quote
Steven P Posted June 5, 2021 Posted June 5, 2021 Also not s LISP, but if you right click drawings tab under the menu bar there is an option "open file location" Quote
tombu Posted June 6, 2021 Posted June 6, 2021 Macro I've used for years: ^C^C^P(vla-activate(vla-open (vla-get-documents (vlax-get-acad-object))(findfile(getfiled "Select File" (getvar 'dwgprefix) "dwg" 8)) :vlax-false)) My acaddoc.lsp starts with (vl-load-com) which could be added to the start of the macro if you don't already have it loaded as most visual lisp requires it. 1 Quote
leonucadomi Posted June 7, 2021 Author Posted June 7, 2021 the macro is great however I need it to open the windows explorer where the other files of the folder where the file comes from are shown Quote
tombu Posted June 7, 2021 Posted June 7, 2021 22 minutes ago, leonucadomi said: the macro is great however I need it to open the windows explorer where the other files of the folder where the file comes from are shown Just replace dwg in the macro with "" to show all files in the folder. Help for getfiled: https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-AD65DF88-5218-4655-B877-B4D33B9FB6D1 To open Windows Explorer in the current directory I use the macro: ^C^C^P(progn(startapp "explorer" (strcat "/n,/e," (getvar "dwgprefix")))(princ)) Command Name: Explore Here... Description: Open Windows Explorer in Drawing Directory Quote
mhupp Posted June 7, 2021 Posted June 7, 2021 20 minutes ago, leonucadomi said: the macro is great however I need it to open the windows explorer where the other files of the folder where the file comes from are shown This will allow you to change the folder location that opens starts in current drawing folder. Need write permission but nothing is saved. ;;----------------------------------------------------------------------------;; ;; OPEN WINDOWS EXPLORER TO FOLDER OF CURRENT DRAWING. (defun C:DIR () (setq path (strcat (getvar 'DWGPREFIX) "\\Enter or Save to Open Folder")) (if (setq fp (getfiled "Folder to Open:" path "" 33)) (startapp "explorer" (strcat "/n,/e," fp)) ) ) /n Open a new single-pane window for the default selection /e Open Windows Explorer in its default view also suggest to get power toys for fancy zone. 1 Quote
Steven P Posted June 7, 2021 Posted June 7, 2021 Try this, (defun c:GetFolder() ;;opens the drawings folder ;; (command "shell" (strcat "explorer \"" (getvar 'dwgprefix) "\"")) (startapp "explorer" (strcat "/e,\"" (vl-string-right-trim "\\" (getvar 'dwgprefix)) "\"")) (princ) ) It's been a while since I made this up but from what I remember it will work either way with the 'shell' line or with the 'startapp' line. Might even work with both and open explorer twice if you leave both lines in. 'Startapp' might be a bit quicker. 1 Quote
leonucadomi Posted June 7, 2021 Author Posted June 7, 2021 47 minutes ago, Steven P said: IT'S EXACTLY WHAT I NEEDED THANKS FOR SHARING Quote
op90o Posted March 31, 2023 Posted March 31, 2023 (DEFUN C:FFF () (COMMAND "_START" (GETVAR "DWGPREFIX"))(PRINC)) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.