algorithmic modeling for Rhino
Before I lose a month of my life messing around with this in Visual Studio, I figure it might be smarter just to toss this out here.
(note: im pulling this example from the sample code thats provided in the grasshopper assembly on the visual studio site)
Im new to trying to right my own .gha in visual studio. Im curious to know the particulars about setting the output data type.
i see that you can create one like so
pManager.Register_CurveParam("Spiral", "S", "Spiral curve");
if in my code i create a my own class (object type) can i set my output as that type ergo
pManager.Register_MyAwesomeDataType(... yada yada yada ...)?
or is the best i can do something like
pManager.Register_GenericParam();
Mario.
Tags:
Hi Mario,
at first you should not use the Register_??? methods anymore, cause they're obsolete. Use the Add??? methods (see the SDK)
You can use AddParameter method to register custom type data...look at this post: http://www.grasshopper3d.com/forum/topics/persistent-data?commentId... and leave the part with persistent data.
Hope this helps,
FF
Yup, you're right. I tried to jump in feet first without checking out the SDK... Lesson learned.
If you create your own data type you'll either have to use the Generic parameter OR you can create a custom parameter class that handles your data type. Then you can create a new instance of this parameter and use the pManager.AddParameter() method.
--
David Rutten
david@mcneel.com
Tirol, Austria
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by