Grasshopper

algorithmic modeling for Rhino

This is my first dabble into the VB.Net Scriptable component and I've hit my first problem.

I would like to have a separate function "Output(Paths)" to create the string for the branches and thus making the code cleaner. However, I get the message as shown. I know why its happening (I think) but I don't know how to correct it.

As a temporary solution to get the component working I have created the OutputPaths as Object with in the Sub Routine.

My next step is to turn this into a component in it's own right so I would like to get this right.

Any and all help welcome.

Views: 247

Attachments:

Replies to This Discussion

I didnt take the time to fully understand what your definition does, but i think i corrected your problem in the script.

A procedure (or sub) modifies one or several of the input parameters, which can be seen as results.

A function IS the result, so at the end of the function you assign the data you want to the name of the function (so Func=result, but not Func(i)=result).

 

Attachments:

Hi Systemiq

Thank you very much.

The vb scipt does the same as the gh components at the bottom of the canvas. It takes a string in the format "0;0;0;....;N" and produces a String of Path structures.

for example a string  "2;3" will produce:

{0;0}

{0;1}

{0;2}

{1;0}

{1;1}

{1;2}

 

Like in the ghx that I uploaded you can then use the replace branches component to apply it to an existing tree.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service