PDA

View Full Version : Script to transfer project standards



sstewart.121399
2009-01-07, 10:28 PM
Don't ask why, but I regularly need to transfer project standards from one template to a hundred (or so) central files.

But I can't see why this script is failing..

It starts the transfer fine, but crashes around 60% of the way through.

Can anyone say what the problem may be, or suggest a better solution??


(I have been testing this on a small batch, with fairly small files. There are no errors when I perform the process manually, and I am using Revit 09 but not the latest build.)



Dim Jrn
Set Jrn = CrsJournalScript
Dim Fname, filex

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("List.txt", 1)
' Browser Deactivate

Jrn.Command "Menu", "Open an existing project , ID_FILE_OPEN"
Jrn.Data "File Name" _
, "IDOK", "K:\\Setup\Revit\Template\defaultPS.rte"

Do While f.AtEndOfStream <> True
Fname = f.ReadLine
set filex = fso.getfile(Fname)
file = filex.name
upgrade Fname, file
Loop
Jrn.Command "Menu" , "Close the active project , ID_REVIT_FILE_CLOSE"

Sub upgrade(namepath, file)

Jrn.Command "Menu", "Open an existing project , 57601 , ID_FILE_OPEN"
Jrn.Data "File Name" _
, "IDOK", namepath

Jrn.Command "Menu" , "Transfer Project Standards From an Open Document , ID_TRANSFER_PROJECT_STANDARDS"

Jrn.PushButton "Modal , Select Items To Copy , Dialog_Revit_ProjectStandardsList" _
, "OK, IDOK"

Jrn.PushButton "Modal , Duplicate Types , Dialog_Revit_PasteSimilarSymbolsTps" _
, "Overwrite, Control_Revit_Overwrite"

Jrn.Command "ToolBar" , "Save the active project back to the Central File , ID_FILE_SAVE_TO_MASTER_SHORTCUT"

Jrn.Command "Menu" , " , ID_RELINQUISH_ALL_MINE"

Jrn.Command "Menu" , "Close the active project , ID_REVIT_FILE_CLOSE"

End Sub

Scott Womack
2009-01-08, 11:09 AM
Don't ask why, but I regularly need to transfer project standards from one template to a hundred (or so) central files.

But I can't see why this script is failing..

It starts the transfer fine, but crashes around 60% of the way through.


My initial guess is that it may be a memory issue. I'm not a script or programing person, but Revit is notoriously bad at releasing memory in the computer. It is a little less so with a 64 bit system, and more memory. The system here at the office has 8 gig of ram, and depending upon the sequence, of commands, I may still get "out of memory" errors.