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: 9587

Reply to This

Replies to This Discussion

Hi Michael 

I already tried the replace null component but it does not fix the problem

the problem is that null and empty are recognized differently by GH, please see Pic for further details


Hope to find a way to fix it

thanks 

Ivan

 Hi Ivan,

Try this Logic, The VB code is just copied and pasted from Daniels reply Below.

There maybe a better way but this is what I can think of off the top of my head

Hope its some Help. Matt

Attachments:

many thanks Matt

this is exactly what I was looking for  :)

cheers

ivan

Actually you can just use null item. 

hey arthur,

from time to time I run into the same problem, so I created a user Object (just a cluster) for that.

try it out...

best patric

Attachments:

this is amazing. thank u so mucho

What I did is put the following in the vb.net component. It will add "null" at empty branches

If x is Nothing Then
a = nothing
Else
a = x
End If

...and with Combine Data.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2019   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service