How to pass Revit Elements parametrically to ConnectionNode.FromStructure? (Type Mismatch Error)

Here is the answer if anyone needs it in future