algorithmic modeling for Rhino
hello,
I am trying to understand GH_ParamAccess Enumeration
it says " Enumerates the types of access that parameters support", but I see no diferences between the 2 lines below. When I run my component, all data inputs work(list, simple item, tree). I thought it was a way to set input data type, like only list input are accepted, or only simple item, .../
Can someone help on this?
pManager.Register_PointParam("Point", "Point", "Point");
pManager.Register_PointParam("Point", "Point", "Point", Grasshopper.Kernel.GH_ParamAccess.list);
Tags:
Hi raf,
you are correct, depending on the param access type you pick you are only allowed to use DA.GetData, DA.GetDataList or DA.GetDataTree. You should get errors when you use the wrong method. However, the Access flag is serialized in the ghx file, so if you change the code, then open an old file which defines different data access flags you'll run into trouble. Basically, you're never supposed to make changes to the input and output parameters of a component when that component has potentially been serialized by someone.
I don't know why you're not getting error messages, maybe you're not loading the gha file you think you're loading?
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Ah, then no. The access does not place restrictions on what sort of data you can supply, only how the component can internally access the data. And of course it affects how the component 'iterates' over all data in all input parameters.
If you have only one input param and its access is set to item, then SolveInstance() will be called once for each element in the data. If the access is set to list, then SolveInstance() will only be called once for every list of items in the data.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
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
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by