Hello fellow grasshoppers,
I’m encountering a frustrating issue with Rhino.Geometry.Curve objects losing their custom data upon modification, and I’m hoping to tap into the community’s expertise!
The Setup
I have a specific Custom.UserData class that I successfully attach to various Rhino.Geometry.Curve objects (e.g., lines, arcs, polylines) within my custom C# components.
The Problem
The core issue is that when I perform common geometric operations that modify or extend the curve, the resulting new curve object loses all of its previously attached Custom.UserData.
For instance, if I take a curve C1 with attached data, and then run an operation like C1.Extend(start, end) or create a new curve through an Offset, the resulting extended/offset curve C2 comes out clean, completely devoid of the user data that was on C1. It seems Rhino’s operations don’t automatically propagate the user data to the new geometry.
The Question
Does anyone have a robust method or recommended best practice for persisting or transferring Custom.UserData from an original curve (C1) to a new curve (C2) that results from a geometric operation?
-
Is there a method within the RhinoCommon API for curves that handles data copying during modifications?
-
Should I be explicitly retrieving the data from the old curve and reattaching it to the new one? If so, is there a reliable way to automate this transfer process across various curve modification methods?
Any guidance on how to manage this data loss gracefully, especially in the context of curve manipulation, would be greatly appreciated!
Thanks for your time and help!