Copy packages

i am trying to get the packages folder copied… i have set it to override…
But i am getting error message :
Warning: FileSystem.CopyFile operation failed.
The file ‘C:/Users/langa1/AppData/Roaming/dynamo/Dynamo Revit/2.10/DynamoSettings.xml’ already exists.

but even if i have set the copy files not to overwrite i get this message

Also get the message file is in use.

But when i get one of these messages none of the files is copied.

I found a python script

import shutil

original = IN[0]
target = IN[1]

List = [] 
for o, t in zip(original,target):
	try:
		shutil.copyfile(o, t)
		List.append(True)
	except:
		List.append(False)
		
OUT = List

but that gives the same result all not copied…

ideally i want the files to overwrite and if for some reason (like file is being used) can’t be copied that i get the false or true so i can specify what files are not copied.


copy_directory.dyn (69.7 KB)

I think the issue here is that you are trying File operations on the files your currently using while running Dynamo. Just like many other files, Revit locks most of the reference files it uses because it may be making modifications to them while operating.

6 Likes

To back up Sean’s answer (which is on the money - he has the ‘solution’ here if you want to give it), I’ve found the best package distribution methods are batch scripts (small scale only, comes with IT security quirks), or folder mirroring features of stronger apps like Endpoint. The benefit of using an app like Endpoint is you can run commands on machines more automatically, and at times where you know Revit will be closed such as just after login, or pre-shutdown.

Currently I’m testing Endpoint deployment at a 400+ person company in the background and it seems to be the way to go. We keep a folder on the server that has the latest packages for use, and we delete/copy to the user package folders. They don’t even know it happens really, and as far as they know all scripts can be run via dynamo player without a hitch.

1 Like

i agree partially… yes some files i want to copy are in use… and i understand i can’t copy those. But most files are still accessable… if i run dynamo and while running dynamo i copy these files through explorer… most files just get copied fine.

So i am searching for a way… to copy all the files that are possible and skip the ones that are being used…

preferably i don’t want to use another system… just want the draftsmen to run the script when we have updated packages…

In my experience copying and pasting isnt usually an issue, it’s overwriting that doesn’t work once dynamo checks out packages. Recommend exploring ways without dynamo for this to allow both copying and replacing.

Something to also keep in mind is that some files are “available” like the settings file, but they get overwritten when Dynamo closes. I fought this for a bit before I do aly reloaded what was going on. I just think you’ll be fighting a perpetual battle if your trying to make updates etc while using Dynamo.

Can you just add a network path to the Package paths so they just update automatically?

Network path are a pain to update because you never know if someone is still using them.
Copying locally i the best way if you don’t want to get a tool like Orkestra

1 Like

I’ve had bad experiences with network paths. They often revert back without clear reasons, and also if the network folder is large to index it can throttle dynamo, especially over VPNs. Since these bad experiences I’ve been 100% focused towards imaging the default appdata folders. Had similar challenges like Daniel with file checkout as well - could almost never update the folders as someone had them in use.

1 Like

oke so going with dynamo sounds like no option unfortunately… i am a big fan of keeping things simple… i think we will keep it manual for now… But if someone has cool ideas i am all ears

Batch files that run at start up?
Every morning when you start your computer it copies the packages. They cant be in use then.

2 Likes

yes i was thinking of that myself too… keeps it simple and no extra programs…

1 Like

I have experienced all of these issues as well, but depending on the size, distribution, and network setup it can be the simplist and most effective approach.

1 Like

We use batch scripts currently (run by the user when they want, with revit closed).

It all hinges around xcopy:

1 Like

We use as well batch file what you can start when you need or when you start your system (Schedule task for batch file)
Batch steps:
delete all exist → make folder → copy