Hello - the gotcha that I see is when you open a dwg file - the Rhino file has not been saved, and there is no path or file name available. Rhino shows a file name at the top of the window but so far I do not see how to get that name in a script.
The upshot is, unless I find some magic way, we either need to open the non-3dm file from a script as well, so that I can keep track of the name, or ask every time when you saveAs
OK - I’ll make two, when I get a chance - one to open, and one to saveAs.
@wm_c - see if this does the right thing… you will need to be careful - if you open a file other than with the opener here, the cached file name and the actual file name will get out of sync and the save will do a very bad thing - you may want to confirm the name during the SaveAs operation - it is an extra step, but probably a good thing.
To use the Python script use RunPythonScript, or a macro:
_-RunPythonScript "Full path to py file inside double-quotes"