Are you trying to use the node equivalent or the backend method? For the node, simply try this:
If you want to dig deeper, you’ll need to check out the freely available source code here:
There’s a ready-made “Convert” method, so all we need to do is to get to the Revit primitive and apply the conversion method: