rs.Command('_Export') in RhinoWIP for mac does not take filename argument as in rhino6 for windows

Hi all,

I’ve used the method in the snippet below to export dxf-files in rhino6 for windows. In RhinoWIP for mac it throws an error: Unknown command: “/Users/username/Documents/untitled_1.dxf”.

It seems the argument is interpreted as a separate command. Can someone help me with this?


import rhinoscriptsyntax as rs

filename = '/Users/username/Documents/untitled_1.dxf'
rs.Command('! _-Export ' + filename  +' _Enter', False )

Hi Tim,

Can you try this:

import rhinoscriptsyntax as rs

filename = r"Users\username\Documents\untitled_1.dxf"
rs.Command("! _-Export " + filename + " _Enter", False )

Hi David,
thanks for the reply. I get the same error with your snippet. Why do you propose backslashes? Do you suspect system (language) settings related issues?

best regards,

Hi Tim,
I though there would be an easy fix, unfortunately not the case. The issue has been filed

@DavidLeon Not visible to public…
I think I ran into the same issue this morning. It seemed like the - version of the command still invoked the dialog box.

Mitch - in case you haven’t checked after that…
Apparently, that was a duplicate YT item and is now closed. The original item is here: RH-44547

OK, thanks Wim - geez, 10 months and hasn’t been fixed yet…

So we’re still nowhere with being able to script a batch export of anything in MacRhino regardless of the version. In V5 current, the BrowseForFolder() method is broken so you can’t specify a destination folder for exported files, and in V6 WIP, the export itself is broken… :confounded:

Hi @Helvetosaur ,

Why is there no function in rhinoscriptsyntax for exporting or saving an array of objects? To me it seems this funtionality is often used for e.g. batch exports like you mention.

All open, import, saving and export functions via script rely on scripting the “Open”, “Import”, “Save” or “Export” commands. I guess this might be because of the sheer number formats that Rhino can import/export. I think via RhinoCommon you can write out a Rhino .3dm file though, but it’s a bit complex.

Just to note that all this stuff works fine in windows Rhino, it’s just in the Mac versions that it’s broken.

yes, I am porting a script to Mac that works fine in windows Rhino. For now I’ll wait for RH-44547 to be resolved. Thanks for the reply anyway.

cheers, Tim