gmmdinesh Posted August 22, 2017 Share Posted August 22, 2017 Hi Everyone I have a folder on (E:\Orders 22-Aug-2017) this path.This folder will be created daily for respective date by Excel. Need lisp to automatically find the folder with today date on that path and saved it automatically. Anyone help me to this. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 22, 2017 Share Posted August 22, 2017 You can get the DATE via lisp so can not see any real problems in finding E:\Orders date etc. Search DATE for various output dd/mm/yy etc. Quote Link to comment Share on other sites More sharing options...
gmmdinesh Posted August 22, 2017 Author Share Posted August 22, 2017 Hi Bigal Thanks for your reply..but i can't understand.. Please can you create the lisp for that... Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted August 22, 2017 Share Posted August 22, 2017 (edited) (defun c:SaveToDateFolder ( / doc fld fnm) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq fld (strcat "E:\\Orders " ;; Change DD to D for 'E:\Orders 1-Aug-2017' instead of 'E:\Orders 01-Aug-2017'. (menucmd (strcat "M=$(edtime,$(getvar,date),DD-MON-YYYY)")) "\\" ) ) (cond ((not (findfile fld)) (prompt (strcat "\nError: Date folder '" fld "' not found ")) ) ( (and (= 1 (getvar 'dwgtitled)) (= (strcase fld) (strcase (getvar 'dwgprefix))) ) (vla-save doc) ) ((setq fnm (getfiled "Save as" fld "dwg" 1)) (vla-saveas doc fnm) ) ) (princ) ) Edited August 22, 2017 by Roy_043 Quote Link to comment Share on other sites More sharing options...
gmmdinesh Posted August 22, 2017 Author Share Posted August 22, 2017 Hi Roy Thanks for your code. I have checked your code. Unfortunately i got error while running the lisp as shown below. Error: Date folder 'E:\22-Aug-2017\ ' not found But i have created the Orders 22-Aug-2017 folder in E drive before run the lisp. Please give me the suggestion to solve the Error. Thanks in Advance. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted August 22, 2017 Share Posted August 22, 2017 I forgot to add 'Orders ' to the folder name. I have fixed this in my previous post. Quote Link to comment Share on other sites More sharing options...
gmmdinesh Posted August 23, 2017 Author Share Posted August 23, 2017 Hi Roy Thanks for your modification. but i got same error again.. Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted August 23, 2017 Share Posted August 23, 2017 Thanks for your modification. but i got same error again.. That is not possible. Try copying the code again. Quote Link to comment Share on other sites More sharing options...
gmmdinesh Posted August 24, 2017 Author Share Posted August 24, 2017 Hi Roy.. Sorry for my previous post, i have checked again it's working good. Thank you so much for your code. Quote Link to comment Share on other sites More sharing options...
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.