How to list DWG create dates (TDUCREATE) ?

How to list DWG create dates (TDUCREATE) ?

Anonymous
Not applicable
1,406 Views
10 Replies
Message 1 of 11

How to list DWG create dates (TDUCREATE) ?

Anonymous
Not applicable

I would like to see the create date (TDUCREATE read-only AutoCAD variable) for many DWG files at once. I have hundreds of files and cannot open each one. Does anyone know how to do this?

(I have zero experience modifying AutoCAD)

-Don

0 Likes
Accepted solutions (1)
1,407 Views
10 Replies
Replies (10)
Message 2 of 11

SeeMSixty7
Advisor
Advisor

I am not really sure as to why you are so concerned about the TDUCREATE information as it really has very little real value to establish such. There are so many ways to create a drawing and not have an accurate representations of the actual start date.

 

but... You asked.

 

As @_gile has suggested in other posts to use ACCORECONSOLE.EXE and a script file. Add in some AutoLISP and you can run through and dump the values to a text file.

Create a BAT or CMD file similar to this. (Something like QTest.CMD)

echo off

:: Path to AutoCAD core console
set accoreexe="C:\Program Files\Autodesk\AutoCAD 2019\accoreconsole.exe"

:: Path the directory to process
set "source=C:\MYFiles\Location\Path"

:: Path to the script to run - Make sure this is on the trusted path in your AutoCAD Settings (Options->Files)
set script="C:\MyTrustedLocationACADPath\myscript.scr"

FOR /f "delims=" %%f IN ('dir /b "%source%\*.dwg"') DO %accoreexe% /i "%source%\%%f" /s %script%

:: comment the following to automatically close the console when batch ends
pause

Create a Lisp File to do the work for you. (something like QTEST.LSP) - This file must be on the trusted path as well.

(defun c:writeouttdcreate()
	(setq myfile (open (strcat (getvar "dwgprefix")  "mydata.txt") "a"));
	(if myfile
		(progn
			(write-line (strcat (getvar "dwgprefix") (getvar "dwgname") ": TDUCREATE = " (rtos (getvar "TDUCREATE") 2 8)) myfile)
			(close myfile)
		)
	)
	(princ)
)
(c:writeouttdcreate)

The above will write to a file call mydata.txt in the same location of your drawing files.

 

You need a script file to run the LISP routine. Create a SCR file (something like QTEST.SCR)

(load "qtest.lsp")

Update the QTEST.CMD file to the appropriate locations and paths and then run it!

 

Good luck,

 

 

 

Message 3 of 11

JamesMaeding
Advisor
Advisor

@SeeMSixty7 

I was all hip to one up your reply, but tried getting a drawing var using dbx doc approach and failed.

I then found this:

https://www.cadtutor.net/forum/topic/45968-vla-getvariable-using-objectdbx/ 

dang it.

So next approach would be using .net, which is how I do it for the PurgeIDs (File Batcher) prog I give out.

@Anonymous 

what acad version you running?

 

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 4 of 11

JamesMaeding
Advisor
Advisor

@Anonymous 

The point @SeeMSixty7  made about the creation date not being reliable is true.

I do progs that tag the drawing with username and filesize each time they open, and they build up with drawings that get save-as'd over and over.

That date likely has nothing to do with the current filename, just when its ancestor evolved from the goo.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 5 of 11

SeeMSixty7
Advisor
Advisor

@JamesMaeding I'll use OBDX to process a lot of drawings as well. I haven't ever tried to use it to get variables, Reading that post you had, I'm going to have to go look and make sure now. LOL Thanks for that!!!! haha. I was trying to keep this simple to avoid having to implement a whole interface to collect the Dwg Paths he was looking for, and it's pretty simple process to use that accoreconsole to drop out the UI and have dos simply feed it filenames. Not as quick as OBDX processing or even using c# and .net. ARX would scream through it.

0 Likes
Message 6 of 11

JamesMaeding
Advisor
Advisor

@SeeMSixty7 

right on. check out my free batcher if you want to see speed of .net:

Batcher

It purges, changes layer settings...all kind of things. Works for bricscad too, as all of my tools do.

I believe .net is as fast as arx, within a "nothinth" of a second (HHGTTG...).

For some reason, the whole scripting scene kind of died out recently. We used to use them all the time with the CADFx batcher, then they discontinued it. I have not found a decent script batcher since then.

I got the scriptpro code and modified it to work correctly, but I don't like it much.

Coreconsole is ok, but the masses need a decent GUI front end with added features like the cadfx one had.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 7 of 11

SeeMSixty7
Advisor
Advisor

I'll check that out, Sounds like we need to write a program to provide for the masses! 

I wrote a really crude script generation system a long time ago, that just works, so I use it. I agree it would be nice to have something simple. I heard a lot of good things about scriptpro in the past, just never used it.

 

Send me a pm here on the support forum if you want to talk more about this stuff.

 

 

 

0 Likes
Message 8 of 11

Anonymous
Not applicable

I think I'm 100% clear on how TDUCREATE works and still need the capability mentioned in my original post.

I'm running AutoCAD 2019 Mechanical.

 

0 Likes
Message 9 of 11

JamesMaeding
Advisor
Advisor

@Anonymous 

Cool, you won't misuse then so that's all good.

I'll see if I can add a system var report to the batcher thing I mentioned.

That is why I asked your version as I have to compile .net for each version.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 10 of 11

Anonymous
Not applicable
Accepted solution

Thanks for everyone's help & input on this.

Message 11 of 11

john.uhden
Mentor
Mentor

LOL!  Sheldon Cooper should start investigating "The Goo Theory."

John F. Uhden

0 Likes