Hmmm... Schedulable it says. So I could have a scheduled script that fires up Revit and does an Audit late at night? That might might be cool!
Gordon
|
|
|
Hmmm... Schedulable it says. So I could have a scheduled script that fires up Revit and does an Audit late at night? That might might be cool!
Gordon
Yep. I guess the easiest would be to create a journal with those keystrokes: open the file and check the Audit option, save the file and exit. Then make an AHK script that runs that journal, compile into an exe and add it to the scheduled tasks.
It would seem that what you're suggesting is completely feasible. A while ago I was running successive File > Open > Detach from Central >Save-as sequences using a journal file for every project in the office (THANK YOU, STEVE!!!), creating an Archive by date, but I had to drag the *.txt files manually and wait for it to finish running.
What you're proposing by putting the AHK *.exe in Scheduler to kick on overnight would be an improvement to that process. I'm not sure, though, if I would do an Audit unattended if there were corrupt elements present since the Journal would enter interactive mode and hang out with the file open...but I really like the idea.
LC
Well, the main problem would be that if a link to a dwg or a linked Revit project cannot be found, a window is going to pop up right? So if you run it at night, I'm not sure what would happen in that case. One thing that can be done is to make your AHK script trap a particular window (see the example I posted for how I dismiss the dialog that notifies you that the central has been moved/copied). So certain things I guess could be incorporated into the AHK script since they cannot be predicted in the journal.
As to the issue of errors when auditing, I don't think Revit gives you any options as to what to do anyway, so I don't think this would be a problem. In your AHK script you could do some sort of a timeout to make sure Revit closes so the next scheduled task can run and not have a "pile-up" happen if Revit hangs there in interactive mode.
I've just been doing some experiments and I think that I can actually improve this script by making a dialog pop up and give the user 3 choices (detach from central, select worksets or just open). I'll have the script write a journal to the C drive each time it runs and then delete it (or delete when it starts). Actually I'll have it write to the Journal folder so they'll be organized with the rest of the journals. I'll keep you posted on the progress.
Hey David, when you say "Write a journal" do you mean your script is actually generating all the Journal text? Did you find some resource to help you understand how Journals work, or did you just reverse engineer them? I am hope for the former, that you might share, cause I have neither the time nor the brains for the latter it seems
Thanks,
Gordon
Unfortunately, it's reverse-engineering & trial and error Once I figure out the exact syntax, I can have the AHK script generate a txt file and use it as a journal to run in Revit. That's how I found it possible to give the user the option to open the local or select worksets or detach from Central. I haven't finished this yet, but I know I can do it. It'll take me a couple more weeks to get back working on it though. In the meantime, the following is what I found is necessary to have Revit fire up, start loading a local and prompt you to select worksets:
The above assumes your file is located in your root of C:\ in a folder named "Revit local Files". Copy the entire text, including the ' at the beginning or it won't work!PHP Code:
'
Set Jrn = CrsJournalScript
Jrn.Command "Menu" , "Open an existing project , 57601 , ID_REVIT_FILE_OPEN"
Jrn.Data "File Name" _
, "IDOK", "..\..\..\Revit Local Files\filename.rvt"
Jrn.Data "WorksetConfig" _
, "Custom", 1
Wouldn't it be great if the Factory would just post a PDF documenting the silly Journal format. It must exist internally, and there is no encryption or proprietary information in a Journal file. And yet the ability to make maximum use of an incredibly powerful tool is severely limited, and what we can do comes painfully. I just don't get it.
Gordon
I finished editing the AHK file originally created by David Baldacchino to suit our office standards. I have attached both the exe and the ahk files.
The exe can reside anywhere. When you run it, if it finds a file with "central.rvt" ending, it creates a local file in the "C:\Projects\XXXXX\" where XXXXX is a 5 digit project number which it gets from the first five letters from the central file (for eg. our typical central file is named as "07074-someprojectname-central.rvt").
If no Central is found or more than one exists, a dialog opens to let you browse and select the correct central file. The script does not check for the discipline etc (differs from David's file) because we just have RAC 2008. The rest it does the same thing as David's
David's file has been a great help to us. We have had people saving their local on their desktop, etc and now it can be easily standardized! We just leave the exe on the network and just copy a shortcut to the project folder!
Thanks
nicholas