Upgrade
Files
- AuthComponentUpgrade.cs
This file defines an `AuthComponentUpgrade` class that implements the `IGH_UpgradeObject` interface to facilitate the migration of a Grasshopper component from version 1 to version 2. It specifies the unique GUIDs for both the source (`AuthComponentV1_OBSOLETE`) and target (`AuthComponentV2`) components, along with an effective date of December 15, 2025. The core logic resides in the `Upgrade` method, which checks if the target object is the obsolete version before instantiating the new component. It then utilizes helper utilities to migrate input parameters, specific output parameters, and finally swaps the old component with the new one within the document. If any step fails, the process returns null on failure, ensuring data integrity by returning the newly created component upon success. This mechanism allows users to automatically update their definitions when opening files containing the deprecated component.
- GlassAnalysisComponentUpgrade.cs
This file defines a Grasshopper component upgrade class named `GlassAnalysisComponentUpgrade` that facilitates the migration from version 1 to version 2 of the Glass Analysis component. It implements the `IGH_UpgradeObject` interface, specifying the unique GUIDs for both the source (`V1`) and target (`V2`) components along with an effective date. The core logic resides in the `Upgrade` method, which instantiates the new component type and utilizes helper utilities to automatically migrate input and output parameters from the old obsolete component instance. Finally, it replaces the old component in the document with the newly upgraded one using `SwapComponents, ensuring continuity by preserving connections and returns null if any step fails or if the target is not the expected obsolete type.