|Arch -> Utilities -> Mesh to Shape|
This tool converts a selected Mesh object into a Shape object. Note that this tool is optimized for objects with flat faces (no curves). The corresponding tool from the Part Workbench might be more suited for objects that contain curved surfaces.
This tool can by used in macros and from the python console by using the following function:
turns a mesh into a shape, joining coplanar facets.
If mark is True (default), non-solid objects will be marked in red