hi guys,
I am wondering how to leave an input empty while not stopping the component to run.
Here is what I have: The input is supposed to be a List of integers:
pManager.AddIntegerParameter(“obstacles”, “obstacles”, “obstacles”, GH_ParamAccess.list, new List() { });
(I dont know about the “new List() { }”, was just something I tried)
Appart from that I have added in my
“protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)”
method the following:
pManager[15].Optional = true;
which is my obstacle input above.
Further more I have been adding this in my SolveInstance:
obstacles = new List();
if (!DA.GetDataList(15, obstacles))
{
return;
}
Now, everything is fine if I plug an input with no data:
But I want this to work without me providing data at all:
Basically, if the obstacles List of integers stays empty, there are just no obstacles…
Any idea how to do this? Might just be an issue of not knowing the syntax…
Thank you!