In c# in grasshopper, I defined a list and add the data(points) inside this list, but the data is not available in this list.
private void RunScript(List<Point3d> iPoints, Point3d iTarget, ref object A)
{
myComponents.Target = iTarget;
myComponents.oPoints = iPoints;
...
A = oPoints;
}
public class myComponents
{
public static List<Point3d> oPoints(); //this is where the coding is wrong
...
}
I expect in oPoints list there would be the points from iPoints, but there is nothing, and the error message is: Error (CS0501): 'Script_Instance.myComponents.oPoints()' must declare a body because it is not marked abstract, extern, or partial (line 101)
If you intended to define a method you'd have to declare a body:
public static List oPoints()
{
//Body
}
If you intended to define a field you need to remove the ().
public static List oPoints;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.