Grasshopper

algorithmic modeling for Rhino

How to replace an <empty> branch with a null branch or a "0" value?

Hi Guys,

How could I insert a null branch (or a "0" value) where there are <empty> branches? I tried replacing empty ("") strings but the "replace string" components does not recognize empty strings. Confused.

Many thanks,

Arthur

Views: 19828

Replies to This Discussion

Hi Arthur,

Try this one.
It's a bit cumbersome, but it could be useful, until somebody posts a more elegant solution.

Attachments:

Hi , test null recognises empty branches, and if you plug a string to a number it returns a null item

This is my usual solution...

Thanks a lot Andrew! Is the null component from GH just out of curiosity?

You can make it as a cluster, with only cluster output.

Thanks Djordje! What would you place in the cluster though?

You can use either this solution, or above presented by Doctor No.

Attachments:

Hi Arthur et al.

I'm sure since 0.9.0002 there has been a component dedicated to this. Not at a computer to check but there should be a [Replace Null] component. Might not work on <empty> though.

Danny

Hi Danny :) Unfortunately the replace null doesn't replace <empty> branches from what I have tried.

Hi Arthur,

try this solution.

Attachments:

HI David

I have a similar problem , I have a set of line lenghts components....whenever some of this component is empty I would like to get a "0"  on the output thus to populate a list having always same nr of items + to use those 0's for further calculation

I tried to use your definition but I am not able to convert those empty  panels in to useable numbers ( 0 ) 

any advice ?

many thanks , cheers

Ivan

Im pretty sure there is a replace null component now.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service