I can’t trace it back, but I believe to have read a while ago that from a certain Revit version I could install packages in a different location instead of the User/Roaming location.
If this is not from 2024 onward, how can I make an install script to copy and overwrite directories? Then I can manually copy the packages folder to our office server, make a button on our pyRevit hosted Toolbar and instruct everyone to install the latest packages. (This way I can also circumvent any individual Orchid installation as well)
I know how to copy directories, but I can never really see the result, not to mention the User/Roaming folder that everyone has, has a different name dependent on Windows Language and Windows User name.
The Dynamo settings file has allowed you to add paths for packages since the 1.0 days. However you don’t want to load packages from a server due to the many infosec issues therein. Loading from another C drive location is doable, however the default user folder is most secure and stable.
From there it’s copying directories and folders. Be sure to keep all structure and catch all files recursively. I recommend you review the task with your IT team first as they likely have easier ways to accomplish this (i.e. on login via GPL, Robocopy, etc.). Also if you go the Python root make sure your Infosec/IT team reviews to ensure they whitelist copying executables in any future security updates.
These can be imported via the new tools there, or you can programmatically set them as you would by editing any other text/xml document, or you can manually configure them in Dynamo. Going back as far as 1.3 they are in “Settings > Manage Node and Package Paths”, and in new builds (3.0) they are in Dynamo > Preferences > Package Settings > Node and Package File Locations
Not necessarily - it is more ‘future proof’ in that .NET is much more stable than Python as there’s only one flavor and therefore you have less things to worry about if you’re trying to scale stuff for deployment. You can grab a similar set of code to get the appdata path via C# just as readily if that’s what you’re after. .net - C# getting the path of %AppData% - Stack Overflow
If you’re already in .net then it might be easier still to build an installer which you just put on the network to have people run. Or even your own application which just checks for updates on your central location and installs the latest, even letting you know if someone has added something from outside the norm so you can track people experiementing and such.
Where is this supposed Settings button in pre 3.0? I don’t have that button in my Revit Dynamo. If you meant the xml, then yeah I understand they added the button in 3.0 under ‘Preferences’
The UI refresh happened somewhere in 2.X (2.12?). In older versions you have the Settings dropdown and in newer versions you have the Settings panel. It’s just those two locations.
Thanks. I’ve changed it now and I’ll see how this works. I guess I will have to configure this for each Revit user in the office and with each Revit install?
So I would basically have to write a script that only overwrites the XML file so the next time Dynamo is used, the packages are loaded from the server.
Put that script behind a pyRevit toolbar button, and we’re good to go.
Copy the package content from the server to the local disc for each environment you want to have (i.e. one set for Revit 2022, another for Civil 3D 2022, Another for Revit 2023, Another for Robot 2024, etc.).
Check the user’s package directory for any additions and track those.
Set the settings for each environment to map tot he directory which you put the packages.
Copy updates to any environment to the local disc directories on each update.
Copy the standard graphs from the server to the local disc and set the settings for player to use those.
The best way to do these isn’t PyRevit or a script run on demand, but something which is triggered by your organization’s IT tools to make that all happen automatically before Revit even starts. You have several options:
Robocopy
GPL script
BAT
Powershell and other Windows tools
No one on the forum can ‘write one of those for you’, as no one on the forum is aware of your IT structure and infosec policies; your IT team can do all of the above in less time than than you’ve already spent, and it will be far more robust and scalable.
If you do want to try and script around it, build a .py that runs without PyRevit or other tools. Once the user launches Revit you might not be able to overwrite new package versions from the server path.
So I am the only Dynamo script developper in our company. I managed to get them to install certain plugins such as pyRevit. Any script that I roll out I will put in through the custom Toolbar that I use. That way everyone just has to press a button and all their Toolbar tools will work.
Since I use packages, with the most extensive one being Orchid, I don’t want anyone to have to open Dynamo at all. Let alone do even more installs that confuses everyone.
We have a local shared network where we put our Workshared models etc. I can use this to put shared content such as the packages. It is easier for me to test packages personally, create the script and copy the files so everything updates automatically for the rest.
So when a new Revit comes a long, I can just update the script behind the toolbar button and the rest of the toolbar should work then as well.
A common best practices for InfoSec is to block remote code execution (meaning running code on your system which is pulled from another system); not doing so puts every device on your entire network at risk. And so while you might be able to put DLLs on the server today, it is unlikely you’ll be able to keep them there for the duration.
While you’re the ‘only’ one today, it’s unlikely to stay that way unless your firm is just you. The number of skilled Dynamo users coming out of colleges today is VERY high - it’s not as much of a a niche specialty anymore. And so eventually others will want to install packages, and those packages might conflict with what is on the network (i.e. both might have a List class). When this happens (not if), things will work for that session, but once they restart Revit the conflict will prevent proper execution. By not monitoring as I noted above you’re setting yourself up to have to fight this eventually.
Putting packages on the network slows down launch of Dynamo (and anything which has Dynamo as a dependency - such as player). It also slows down search in Dynamo, which isn’t something that Dynamo can control as it’s a windows thing.
If you’re administrating environments for your users, you’ll need to test as them. By having a ‘copy local’ setup by default testing is a much easier task as you cannot test scaled deployments in your development environment.
The idea of ‘updating the script’ isn’t as simple and straight forward as you’d like. Even the ‘if version == 20xx’ code is adding significant overhead to your graphs execution time and makes your code and testing 4x what it needs to be. Loading the the environment specific version will be an order of magnitude faster if you do it right. The development process also becomes easier to maintain as you don’t have to update and then back test 4+ Revit environments (remember any one Revit add-in can break your graphs so you have to test everything you deploy in every environment it is deployed to).
By deploying once you instead have a workflow like this:
You build for as if you build and test for version-3. Deploy when done.
Then save as test and modify for version-2, Deploy when done.
Then save as test and modify for version-1, Deploy when done.
Then save as test and modify for version-2, Deploy when done.
If an API call is added in version N to N+, always starting in the oldest build available.
The pain that will be managing topography tools from Revit 2022 to 2025 is a good example of where this will save you time, and when there isn’t any update required (say setting up worksets) you just save as, test and deploy for each new release of Revit.
You used the term developer correctly here. You are the automation developer for your firm. Working like one will help you in the long run even if it means you need to spend an extra 2 hours and partner with your firm’s IT team (the guy who sets up people logging into the network) to get started.
We are a small firm of 30 people max. About 20 of us work with Revit.
They hire for custom work mentality. I use Dynamo for my own curiosity and development and I managed to alleviate a lot of repetitive work and frustrations we have with Revit.
But the focus remains on the projects, not on any extra curricular activities such as Dynamo. So as long as I am there, I want things to run smooth. So updating a button seems much easier.
I understand your perspective of wanting to optimise, but all of us only use 2 revit versions at once (we skip every uneven Revit numbers). So all thos extra versions and updating every script hasn’t really happened nor do I anticipate it. I’m not running 100’s of scripts in that toolbar and mostly have been tested in such a way that they work as intended, when they stop working I can look into it for that version (which I did earlier this year, when I discovered on the forums here about categories needing “OST_” in front of them in the case of Ceilings)
We don’t have an IT guy. An external company manages our IT. I’m not going create a “ticket” and outsource this when a script can do the job as well. A job I am overseeing, for as long as I work there. If I were to leave, it’s not really my problem anymore anyway.
So I think you have the wrong scale in mind. Thank you for your advice and consideration, but really let’s refocus on the how I were to do this instead of the why
So I did some testing and moved all packages to the server.
Now I get this error.
No idea what a blocked assembly is or how to unblock it. Any ideas?
EDIT:
Yeah just found this, I guess this whole Idea of making it automated will require all package content to be downloaded onto the personal drives. Bummer. I thought the .xml file change would be enough
Looks like your IT guru already locked you down on this. The good news is things now get easier in the long term should you move to copying to each local environment rather than just solving the problem for yourself today.
I just made this script, but especially for testing I would like the windows copy progress bar to open up. I don’t know how else I can monitor the progress of this.
Otherwise I want the script to open the folder once it is done. That way the user can know something happened.
I tried stea… copying the python node from the @GavinCrump Cumple package into the project but that just gives me error.