Hi all,
I thought this question might have been asked thousands of times but looking at the forum I couldn’t find an exact answer. I’ll try to make this as comprehensive as possible so hopefully can become a resource for anyone having the same issue in the future.
The problem: we’re developing custom code to solve specific parts of different GH scripts we have. what we do at the moment is using the C# component. The problem happens later when we have a newer version of that code, which means we have to open all previous GH files that have used it and manually update them.
The possible solutions: looking into ways of solving this there seem to be a few pathways:
1- Make a GH package and publish it publicly on the package server. This was suggested because of the internal Package Manager, and the functionality it has to recognise new versions:
The problem, however, is that it doesn’t give a notification to the user. So the user can continue on using the old component, unless they update the plugin manually.
2- Create a separate component that checks the version of used components, compare it against the newest version and somehow flag it to the user in the ‘dashboard’ of the GH file. This is somehow similar to the way Ladybug checks the version of their components using the LB Versioner component.
This is great but I’m guessing it works because LB components are python based. So they can be overwritten while Grasshopper/Rhino are running(?). Under the hood this component runs the pip install in the command line or downloads the specific version of files from Github. Our components are going to be .Net based so I’m guessing we can’t have a component that downloads the latest files and overwrites the old ones, as the old components get loaded and files get locked when Grasshopper is first running. Could a .Net based plugin use this approach in any way?
3- Make the components as a separate GH file and using Hops, point to a location on server where the GH files are. If there will ever be an update we theoretically only need to replace that GH file on the server. As long as the inputs and outputs are the same things should work. But, a couple of issues with this solution. Firstly we need one additional license allocated to that Rhino instance that’s running on server which are currently a rare thing in our office. Secondly, some of the components we’re developing need to be running on the local machine because they need to interact with the Rhino instance that the user has. eg: if we want to use a C# component to take a screenshot of the viewport, we can’t use Hops for that. Is this assumption correct?
4- Somehow automate updating the custom components. Eg, creating a script that automatically opens GH files, one by one, checks the version of a specific component, if it’s old replace it with the new version. Save and close the GH file. I’m not sure if this is possible at all but if so, pointers on how to do this are much appreciated.
Is there any other possible way to tackle this problem?
If not what would be the best way out of the suggested ways above? We need a solution that:
- Doesn’t require additional Rhino license.
- Gives a notification to the user about the old components when they open the GH file.
- Can update the .Net based components, ideally by triggering that action from a “Versioner” component.
- Can interact with the running instance of Rhino.
Thanks in advance.