Set attribute keys by layer?


I was wondering, is there a way to copy all unique attribute keys from the geometry of a layer to the geometry that does not yet contain these attribute keys? I could think of this as something similar as the SelLayer dialog where you select the layer, but instead of selecting the layer, it copies the attribute keys of a layer to all of its geometry which does not yet contain these keys.

For context: I am currently experimenting with attributes for a complex grasshopper script. It involves reading attributes from curves and using the attributes to determine the generated geometry in the script. As such, I reference a layer, which contains a particular set of curves (streets, buildings, etc.). All these curves should have the same attribute keys. If I create new curves, I need to copy the attributes back to them (often I don’t know which curves do and which curves don’t have the attributes yet unless I add a custom preview in Grasshopper for curves with no attributes).