I have a question about setting default inputs for zerotouch nodes. In my projects it can sometimes be convenient to have some predefined default input, so that the user need not plug something into that port. Does anyone know how to do that?
For instance below I can set the string Description to an empty string, but how could I set the curve list to an empty curve list?
Thanks!
public static List<object> ExampleCode(List<Autodesk.DesignScript.Geometry.Curve> Curves, string Description = "")
{
List<object> ObjectToReturn = new List<object>();
//code here
return ObjectToReturn;
}
you can use the default argument attribute to execute a snippet of ds code.
or you can use a default token - which you check for in your code, ie, something like null - but not null (since that is a special type) which dynamo interprets as nothing being connected.
it will work if you use null from inside a default argument attribute though.
This normally happens if you save a graph with your ZT node in it and recompile a new version of the node with either new default inputs or change an existing input to have a default input; when you reopen the graph, the default value will not be automatically set.