woodman78 Posted February 6, 2012 Posted February 6, 2012 Hi all, We have recently changed the way we store issued drawings. I am looking to for lisp that will create a folder but I want to take the folder that the current drawing is saved in and add \Issued_Drawings and then prompt for the name of the new folder. Can it be setup to have the current date in the format YYYY MM DD as a default in a dialog box? Thanks. Quote
MSasu Posted February 6, 2012 Posted February 6, 2012 You can use the CDATE system variable to get current date: (setq theDate (rtos (getvar "CDATE") 2 6) theYear (substr theDate 1 4) theMonth (substr theDate 5 2) theDay (substr theDate 7 2)) Regards, Mircea Quote
Lee Mac Posted February 6, 2012 Posted February 6, 2012 I use the DIESEL edtime function when I require the date, for example: ;; Get Date - Lee Mac ;; A wrapper for the edtime DIESEL function (defun LM:GetDate ( format ) (menucmd (strcat "m=$(edtime,$(getvar,DATE)," format ")")) ) _$ (LM:GetDate "YYYY MO DD") "2012 02 06" _$ (LM:GetDate "HH:MM:SS\",\" DDDD DD MONTH YYYY") "11:31:55, Monday 06 February 2012" Reference: edtime $(edtime,2452000.0,D.M.YYYY) ==> 31.3.2001 converts a real number to a date-formatted string. First argument: number representing a Julian date in AutoCAD, e.g. as returned by $(getvar,DATE), or a UNIX date in the original source. If zero, uses the time/date the macro was started. Second argument: sequence of formatting codes D: day 4 DD: day with leading zero 04 DDD: day of week short Mon DDDD: day of week long Monday M: month 6 MO: month with leading zero 06 MON: month name short Jun MONTH: month name long June YY: year two places 12 YYYY: year four places 2012 H: hour 7 HH: hour with leading zero 07 MM: minutes 30 SS: seconds 30 MSEC: milliseconds 300 AM/PM: upper case AM or PM AM am/pm: lower case am or pm am A/P: upper case A or P A a/p: lower case a or p a Quote
woodman78 Posted February 6, 2012 Author Posted February 6, 2012 Excellent stuff LeeMac. Thanks. and you too msasu. I'll be back with questions no doubt. Quote
BIGAL Posted February 7, 2012 Posted February 7, 2012 Not sure if you know this but use (VL-mkdir "dirname") 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.