Grasshopper

algorithmic modeling for Rhino

How to create and use a custom data type that contains a geometry and an int?

Hi! I am trying to create a data type "IndexedGeometry" that wraps up a geometry and an int as an index, and I want to write a "Sequencer" component that automatically assigns indices to geometries and output this IndexedGeometry data. Could anyone tell me:

1.Which interface should I implement or which class should I inherit from to create this new data type? (I tried to inherit from GH_GeometricGoo<IGH_GeometricGoo>, but when I test my component, I get "Cannot create abstract class" runtime error.)

2.I guess I need to write a parameter that inherit from GH_Param<IndexedGeometry>. If so, what code should it contain?

The "Sequencer" component image below might explain what I want achieve better.

Views: 480

Replies to This Discussion

I derive from GH_GeometricGoo for my similar classes.  Make sure you have a constructor with no parameters.


It would help to advise further if you posted your code.


Cheers,


Jon

Thanks, Jon!

I checked my code again and it works now. 

Peter

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