Batch export command documentation

Continuing the discussion from Batch export from a file:

Is there a place where I can find documentation on the rhino commands? I understand the calling of rs.Command(’_Export’) but how do I know the formatting of the string that’s following the “_Export”? I’d like to batch export other file formats than .stl and each seems to have different parameters

Hi @Will_Wang,

Here is the help on command line scripting:

https://docs.mcneel.com/rhino/5/help/en-us/information/rhinoscripting.htm

And here is a sample script to export STL files.

https://github.com/mcneel/rhino-developer-samples/blob/6/rhinoscript/BatchSaveSTL.rvb

Note, each file export format may have different command line parameters. Thus, you will want to manually script the command and note well what parameters you want to set.

– Dale

I was looking for the command line parameters. Are those documented for each command?

Hi @Will_Wang,

Command options are documented, yes.

– Dale

Could you provide an example string for exporting .ai file?
I’d imagine it would be something like this but this is obviously wrong…
_Export "C:\user\desktop\test" _Format="ai" _Scale="1:100"

Rhino help on command “export” only has three options: save small, save geometry only, and save textures.

Try this:

_SelAll
_-Export "C:\Users\<your_user_name>\Desktop\Test.ai" _Enter

– Dale

1 Like

The suppress dialog hyphen was key…now I can see all the parameters in the log
On the matter of .ai I wish there were a scale option in the command line export like in the GUI

If you set PreserveUnits=Yes, you will see a whole bunch more command line options.

– Dale

1 Like

Thanks Dale! I’ve just uncovered a whole new realm today. Kinda wish there is a structured documentation like the RhinoCommonSDK. Like this PreserveUnit toggle activating even more options. It’s quite hidden. But I think by trial-n-error I can learn it more thoroughly.

For getting the options in Rhino commands, use the Rhino Help file, it’s quite good, all the options are documented with explanations…

Yes, well, scripting Rhino commands is a bit trial-and-error, you can first try to create a macro that works using the MacroEditor, then you need to figure out how to set it up to run in the script. To test the script, you will probably need to run it several times, hitting F2 after each run to bring up the command history and see how Rhino is actually accepting your scripted options.

–Mitch

I’m finding more information now in the help file. Didn’t have time to dig around. Some documents are under different categories. I was looking at export command but I should have looked at file I/O

Hi @dale I have this line of code Rhino.RhinoApp.RunScript($"_-Export SavePlugInData=No {filePath} Enter", true), and I want to export to rhino 6 or rhino 7, how can I do this? What is the syntax to specify “Save as Type”?

just add _Version=6 or _Version=7 to the string

– Dale