I’ve just released a new version of ScriptParasite 2, that can connect to the newer C# and now also Python components. It’s currently available through the package manager as ScriptParasite 2, and obviously, only available for Rhino 8.
This allows you 2-way synchronisation between Rhino and more capable editors such as VSCode, Rider, Visual studio, to do quick prototyping with scripts, and allow easier access to functions such as code completion, AI editting and similar things.
The script parasite for the older versions also remains available as a seperate package.
It’s also available on food4rhino, but with the current requirements for differing builds and .net framework/.net core situations I highly recommend using the package manager over manually installing this.
Disclaimer:
It should be compatible with Rhino for Mac, but I do not own a mac, so I have no way of really testing this. Python support seems to work pretty well as well, but as I do not use python that much, I can’t really tell if this will work.
Just tested it on Mac and it works like a charm! I’ve been wanting to transition to using Mac for a long while, and scripting components was always an issue. Thanks again!
Hi @arendvw nice to see this working again, now we can use the scripts with much wider variety of tools! One questions, how do we reference the rhino SDKs in the external files? I see the project file is no longer created so we have to make a new one?
Hi @arendvw , maybe a silly question but not sure why I can’t see ScriptParasite 2 on package manager or on Food4Rhino. I can only see this one and the latest version in this is from 2023. Do I need a specific version of Rhino 8 to be able to have it? I am currently on Rhino 8.14. But regardless I was assuming I would be able to see it on Food4Rhino. Thanks!
I’ve just uploaded it. Regardless, the preferred way of installing it is using the package manager in Rhino, because there are 4 different versions for different combinations of rhino/mac and dotnet frameworks.
Hi, I’m a complete beginner when it comes to coding. I find it much more convenient to work in VS Code, partly because of Codex or Copilot, which help me analyze and explain code snippets in a comfortable way.
Would it be possible to have autocompletion in VS Code work just like it does in the native Grasshopper Script Component? I think this might be related to the issue I paste below. Maybe over the years something has changed, and it would now be easier to implement. It would be wonderful if, when working in VS Code with Script Parasite, we didn’t lose any of the features offered by the Grasshopper Script Component.
For python I’m not sure, but for C# it’s really doable (It’s the reason I wrote this in the first place, without autocomplete coding is a lot less efficient). My experience is that autocomplete and code navigation in VSCode is really good.
On Mac, whether Script Parasite v1, or v2, if connected to a Legacy C# component, crashes Rhino. v2 works fine with the Rhino 8 new C# Script Component.
Sorry to bother you, but there is one other issue:
Script Parasite v1 would give a class name with an additional number-code of something like:
public abstract class Script_Instance_98c00 : GH_ScriptInstance...
(so each class was different)
Now the names for the Parasite v2 classes are all:
public class Script_Instance : GH_ScriptInstance
This produces a lot of errors in VS Code due to:
‘Script_Instance’ does not implement inherited abstract member ‘GH_ScriptInstance.InvokeRunScript (IGH_Component, object, int, List, IGH_DataAccess)’ [GrasshopperScripts]
Is this this stemming from the new C# Script component or is it relative to something in Parasite v2 itself?
Hello @arendvw . Many thanks for getting script parasite to work again. I’ve finally got around to working with grasshopper more and will be using C# and script parasite. One question in relation to adding the ItemGroups for Rhino and Grasshopper: I was using VScode before with the old parasite and now am using VStudio community edition 2022. I understood how to add the ItemGroups in VScode and if I had a .csproj file in VStudio I could add them there. But all I see with the new parasite is a .cs file which is fine, I can open it with Studio and make edits and when I save them they show up in the C# component in GH. But if I want to compile in VStudio?
My question is should I make a blank project in VStudio and then add the .cs file generated by the new parasite? I’m a little bit of a dummy when it comes to nuget and have not completely learned how to make VStudio dance and sing.
Once again, thanks for all your work.