TheSwamp

Code Red => VB(A) => Topic started by: CADaver on April 02, 2007, 07:28:40 PM

Title: Auto-run routine on any file that hits a specific directory
Post by: CADaver on April 02, 2007, 07:28:40 PM
Not sure where to put this, but VBA seemed promising... maybe?

We're using a steel program called TEKLA, but for the rest of our office we need to export the file to an AutoCAD DWG.  The elements have an assigned color and linetype and the layers are 1 2 3 4 5... etc.  I've written a lispy function to "fix" all the files in a specific directory as a scheduled task, but what I'd really like is something that "knows" a DWG has been placed in a certain directory, then executes the "fix" and saves the file to a different specific directory.  That way our structural guys could just export the file to the first directory and have the "fixed" file show up in the final directory in a few seconds. 

Any ideas where to start??
Title: Re: Auto-run routine on any file that hits a specific directory
Post by: Glenn R on April 02, 2007, 07:37:28 PM
The FileSystemWatcher in .NET sounds the goods for this - more info please.
Title: Re: Auto-run routine on any file that hits a specific directory
Post by: DaveW on April 02, 2007, 08:15:16 PM
VB6 API
http://www.desaware.com/tech/filemonitoring.aspx

VB.NET
http://www.c-sharpcorner.com/UploadFile/thiagu304/FileSystemWatcher03192007133144PM/FileSystemWatcher.aspx
http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx



Title: Re: Auto-run routine on any file that hits a specific directory
Post by: Bryco on April 02, 2007, 11:46:12 PM
It looks a bit like tekla uses vba , if thats the case a sub in vba would be a good way.
Title: Re: Auto-run routine on any file that hits a specific directory
Post by: CADaver on April 03, 2007, 08:07:57 AM
FileSysytemWatcher sounds like the ticket using fwatcher.Created += new FileSystemEventHandler(FileCreated);


Oh cr4p, something else to learn...


Thanks guys, I have a mission.