Grasshopper

algorithmic modeling for Rhino

Making a code module run on a data branch - rather than for each data point?

Hi Folks,

I am trying to get around the limitations of an old program, by using grasshopper to generate an input file for it.

I want to know if there is a way to make a VBA script run once - for a full data branch instead of once for each piece of data received in a branch

To explain what i am doing, lets say I have 10 points, with different X and Y - I want to use grasshopper to generate the code like (Where X1, Y1 etc are X in position 1, y for position 1 etc):

"

<Points>

<Point ID="1" y="y1" x = "x1"/>

<Point ID="2" y="y2" x = "x2"/>

.

.

.

.

.

.

.

<Point ID="10" y="y10" x = "x10"/>

</points>

"

Sort of got it working - but of course I am generating 10 sets of code with 10 points but the same X and Y.

The VBA setup and code I am using are below.

X is X1 to X10

Y is Y1 to Y10

u is a count (so I can loop through each X/Y pair).

Any help, or suggestions of better ways would be most appreciated!

Cheers

LyndonJ

Views: 183

Replies to This Discussion

Posted that a bit early!

After reading around for a  few hours I came across another post i found you can set the input on the VBA component to 'list' rather than 'item'.

Using this and then referring to item(i) got the loop working nicely.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service