This is a learning project which could have utility. Need to check that drawings in different directories are updated at beginning of each month i.e simply look at when it was last saved…current month or previous. Learning from the swamp, put together lisp routine and script to try and automate process.
Script: opens dwg…loads lisp routine.
Routine: …getvar “dwgname”, “date”, “ tdupdate”…julian date conversion functions…compare current month previous month… write-line drawing updated or not updated to txt file…open txt file.
script: qsave drawing close
Getting desired result with one drawing.
Questions:
How do I apply it to multiple drawings in multiple directories if possible?
Can this possibly be done in ObjectDBX…just curious (I know nothing of ObjectDBX except that is extremely fast when run examples I have.)
Will welcome all comments including succinct code improving on what I have now or better ways of achieving same goal.
Thx
FILEDIA
0
OPEN "C:\Folder1\Folder2\Drawing.dwg"
TILEMODE
1
(LOAD "DRAWINGCHECK")
DWGCHECK
QSAVE
CLOSE
;
Routine
(defun c:dwgcheck ( / DwgNam DwgList)
(setq DwgNam (getvar "dwgname"))
(NowDate (getvar "date"))
(SaveDate (getvar "tdupdate"))
(setq DwgList (open "C:\\MyDir\\YourDir\\DwgNam.txt" "w"))
(if (/= MM MM1) (write-line (strcat"Drawing " DwgNam " has not been updated.") Dwglist)
(write-line (Strcat"Drawing " DwgNam " is up to date.") DwgList))
(close DwgList)
(openfile "C:\\MyDir\\YourDir\\DwgNam.txt" )
(princ)
)