Grasshopper

algorithmic modeling for Rhino

23.jpg

How Do u get the GUID of the objects or components connected to a C# script component ??

Views: 2069

Replies to This Discussion

List<Guid> guids = new List<Guid>();

foreach (IGH_Param param in Component.Params.Input)

{

  foreach (IGH_Param source in param.Sources)

  { 

    guids.Add(source.InstanceGuid);

  }

}

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks David now able to select connected objects and manipulate via C# ... :)

What are the shortcomings of setting slider values via C#...

and how can we over come the "solution was expired" exception ?? any ideas ??

Thanks a Ton ..

Attachments:

What are you trying to do exactly?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Im trying to Implement Particle Swarm Optimisation  in Grasshopper which requires

manipulation of sliders or Gene Pool component to evaluate fitness...

Changing a slider during a solution is not allowed. Or it's at least a very bad idea, I'll make sure it's not allowed in GH2, just to avoid confusion.

Galapagos sets sliders first and then triggers a new solution. However your RunScript code runs within a solution, so you're going to have to find a way to delay your slider-adjusting-logic. It's a very similar problem to this discussion: http://www.grasshopper3d.com/forum/topics/failed-to-collect-data?pa...

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Ive done this as yet

Attachments:

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