Author Topic: Drawing Update Status  (Read 2375 times)

0 Members and 1 Guest are viewing this topic.

ziko30

  • Newt
  • Posts: 51
Drawing Update Status
« on: March 26, 2009, 08:27:04 PM »
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
Code: [Select]
FILEDIA
0
OPEN "C:\Folder1\Folder2\Drawing.dwg"
TILEMODE
1
(LOAD "DRAWINGCHECK")
DWGCHECK
QSAVE
CLOSE
;
Routine
Code: [Select]
(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)

)
« Last Edit: March 26, 2009, 09:59:18 PM by ziko30 »
============== Acad Map 3D 2009================

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Drawing Update Status
« Reply #1 on: March 27, 2009, 06:53:43 PM »
Look at ' vl-file-systime '.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ziko30

  • Newt
  • Posts: 51
Re: Drawing Update Status
« Reply #2 on: March 27, 2009, 07:50:40 PM »
Thx...T.Willey.   I was really excited when I saw the little text file popup with the result I wanted. But "vl-file-systime" shows me I have a long way to go before I can engage in swamp argot.  Talk about "irrational exuberance"... :oops:
============== Acad Map 3D 2009================