algorithmic modeling for Rhino
Hi,
I have created some components for my plugin that are supposed to replace some older components. Since the older components are used manifold throughout many of our projects, it would be nice if I could make use of GH's native "Upgrade components" interface.
I kind of figured out how to swap out the old component with the new one, but when I perform the upgrade, I receive an error message on the new component:
1. Solution exception:GetDataList() can only be called on a parameter with access set to GH_ParamAccess.tree
Now, one of the changes that I've made on the new component involes the modification of one of the input parameters from:
GH_ParamAccess.item
to
GH_ParamAccess.tree
However, "GetDataList()", as mentioned in the error message is never used in either the old or new component.
When I save the document and re-open, everything seems to work fine again, but I'm afraid that the error message will trow off the users (as it did with me)
In the SDK I have found a class called: GH_UpgradeUtil
It contains some methods that may be useful in this case, like: MigrateInputParameters , but I'm not quite sure how to use them.
Could anyone shed some light onto this? Any help would be highly appreciated.
Tags:
Well, first of all the error is clearly wrong. It should say "GetDataTree() can only be called on a parameter with access set to GH_ParamAccess.tree". I'll fix that.
If you migrate parameters from the old component to the new component, then you'll also migrate the access flags. You'll have to set the access of the appropriate input to tree again after you migrate the parameters.
--
David Rutten
david@mcneel.com
Thanks David,
It's working now.
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