Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I have a bunch of curves in different curve containers, which I connect to the C# component I am trying to make. Is there any way to find out how many curves are in each container?

Thanks! 

Views: 844

Replies to This Discussion

From a [VB script] component:

For Each s As igh_param In Me.Component.Params.Input(0).Sources
   Print(s.VolatileData.DataCount)
Next

This is the fast and weak way. From VS, within GH_Component, "Me.Component." will be just "Me." (well, "this." in C#). Remember that the access types of the parameter you are going to read their sources should be consistent with the data structure you will give it. For example, you can not select an item access if you are going to give it more than a curve. You should also check null data or invalid curves.

Here's a C# component which harvests some data from it's sources, including what Daniel described.

Attachments:

Thanks guys, that's exactly what I was looking for!

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