Grasshopper

algorithmic modeling for Rhino

Hi!

I found the code for a gh cluster which woud be really helpfull for my project, does someone now how to use it?

Here ist the link: http://parametricsemiology.com/2013/11/28/1538/

Thanks for any help!!

Views: 433

Replies to This Discussion

I'm not sure it's meant to be repurposed, it's a bit of an awkward way to put code on the net...

Anyway, you'll have to copy-paste everything after:

private void RunScript(List staticPoints, List staticCurves, List dynamicCurves, double gravityMult, double centroidStep, double distance, int skip, bool reset, ref object outCircles, ref object outPoints, ref object outLines, ref object outCurves, ref object outControlPoints)
{

and before

}

//

#region customCode

Into the RunScript area of a C# script component, and everything after:

#region customCode

and before:

#endregion   (waaaaaaay at the bottom)

into the custom code region of the C# component.

Then you have to make sure that the component has all the correctly named inputs, with correct type hints and access specifiers. A lot of tedious, complicated work that has clearly already been done by whoever wrote that script in the first place.

I'm in between dinner and dessert right now, but I can see how far I get before the ice-cream melts...

--

David Rutten

david@mcneel.com

Actually, on closer inspection the code as posted can't possibly run. It's got all sorts of weird mistakes in it, like this loop notation:

for (int j = 0; j 0) {

That's just wrong. Won't compile. They also use a type called List everywhere without the correct type code. Since the common malfunction here is the absence of < and > symbols, I'm guessing they pasted the code into a textfield and those symbols were interpreted as HTML tags.

So, long story short, that code is useless. You should ask whoever put it online if they still have the actual GH file.

--

David Rutten

david@mcneel.com

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