Grasshopper

algorithmic modeling for Rhino

Here is the very simple script I am running as a If branch ...

 

Private Sub RunScript(ByVal f As Object, ByVal Ai As Object, ByVal Bi As Object, ByRef Ao As Object, ByRef Bo As Object)

     If f Then

      Ao = Ai

      Bo = Nothing

    Else

      Ao = Nothing

      Bo = Bi

    End If

 

This has worked great for me in the past. However, I am now feeding Ai and Bi with different sizes of data and getting strange results. For example, I send four Lines into Ai and three Lines into Bo. When f is True, Ao produces the expected output; when f is False, Bo gives me four lines of output by duplicating the last one in its list.

 

Any ideas here?

Views: 257

Replies to This Discussion

Hi Shawn,

 

"I send four Lines into Ai and three Lines into Bo."    You mean into Bi?

 

If you plug 4 items into Ao, three items into Bo and one item into f, then the script will run 4 times if the Data Matching is set to Longest List.

 

If you only ever have one value for f, then I recommend you set Ao and Bo to be Tree parameters instead of Item parameters.

 

--

David Rutten

david@mcneel.com

Poprad ,Slovakia

I've been using it like this for ages so the "new" behavior was really throwing me off. Thanks.

Nothing new here. It's been working like this for a long time.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I didn't mean anything changed in the program, it just seemed new to me since I was using different inputs than previously is all.

RSS

About

Translate

Search

© 2022   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service