It is going hard to say where when there is not enough to go on. It would be more useful to see the grasshopper definition instead of just the small code snippet (that on a quick glance looks fine)
yes. the code doesnāt require any additional assemblies so you donāt need to worry about them.
it looks like a very simple error that involves misunderstanding of the basic syntax of C#.
giving us a screenshot of whatās happening inside the C# snippet would be nice. What you posted here has no error, but you might have forgotten to set input types⦠or misplaced the code inside the snippet.
Here is a screenshot of the code.
In Errors Messages there are some problems with lines: 82, 83 ⦠88, 106, 108, 109
But I canāt see these lines in the code
P.S. This is an another code, but problems are the same
You canāt put a function inside a function like that. Your component wants you to implement inside the RunScript function. It takes a Curve and a double, and expects an object reference out.
If you want to have a Curve, three doubles, then you must add that to the component inputs.
Also, you should remove all the assembly references. Most of the DLLs you added are not .NET assemblies, but regular DLLs. You should not need to add any of those.
Hi,
your error is very obvious.
you cannot define a method while defining a RunScript Method. Thatās just how C# syntax works.
put the method definition in the Custom Additional Code.
Remember this order when writing C#, Namespace ā Class ā Properties ā Method.
Namespace is what you called assemblies. we call these assemblies/libraries at the beginning of the code using āusingā (e.g. using System.IO ; )
Here in the Snippet you see public class Script_Instance : GH_ScriptInstance. It means the code is trying to define a class inheriting from the GH_ScriptInstance class.
Then you see the private void RunScript() {} This is the Method that C# is trying to run with. This is where you define what to do.
*if you want to define additional Properties/Parameters or supplementary Methods, Donāt do it inside RunScript(). Do it in the Custom Additional code.
At first it sounds confusing. But once you do more, you understand how the Syntax works. Just like Grammar.