Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter issue when null #2

Open
DominicBeer opened this issue Feb 10, 2022 · 0 comments
Open

Filter issue when null #2

DominicBeer opened this issue Feb 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@DominicBeer
Copy link
Owner

Ensure nulls are set when null is an input - fails if null is last item in a list...

protected override void SolveInstance(IGH_DataAccess DA)
{
IGH_Goo goo = null;
if (!DA.GetData(0, ref goo))
{
return;
}
GH_ObjectivismObject obj;
if (goo is GH_ObjectivismObject ghObj)
{
obj = ghObj;
}
else
{
this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Can only filter ojects built with Objectivism");
return;
}
TypeNames.Add(obj.Value.TypeName);
foreach ((int i, var param) in Params.Output.Enumerate())
{
string name = param.NickName;
if(obj.Value.TypeName == name)
{
DA.SetData(i, obj);
}
else
{
DA.SetData(i, null);
}
}
}

@DominicBeer DominicBeer added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant