File3dm must rely on a file or a memory stream. You cannot convert ActiveDoc to File3dm directly. You can build a File3dm and insert geometry from ActiveDoc into it.
I’m afraid you cannot use jSwan to (de)serialize geometry. It is doable thourgh my plugin, or Json support from Shapedrvier’s plugin