Write obj without prompting

When I call the function DocumentParser.writeObj the prompt asks the user to “select meshing options”. How can I save an obj file without asking the user to enter this value?

Hi @victor.munyoz,

I am not familiar with this class or method. Can you provide some sample source code, that we can run here, that repeats what you are seeing?

– Dale

I’m sorry, the function writeObj was mine…
The function is actually:

var tmpFileName = Path.GetTempFileName() + ".obj";
var script = $"_-SaveAs \"{tmpFileName}\" _Enter";
RhinoApp.RunScript(script, false);
var bytes =  File.ReadAllBytes(tmpFileName);
File.Delete(tmpFileName);
return bytes;

Any idea of how to avoid the prompt when running these lines of code?

Hi @victor.munyoz,

How about this:

var script = $"_NoEcho _-SaveAs \"{tmpFileName}\" _Enter";

– Dale

I tried the option “_NoEcho” but still the same problem.
It keeps asking to “select the meshing option (DetailedOptions PolygonDensity=50)”
Am I doing somethink wrong?

Hi @victor.munyoz,

No, you are not doing anything wrong. But you will need to provide meshing parameters in your script.

– Dale

When this message appears, I always click Enter (I assume it selects some default parameters)
So, I tried to add an extra “_Enter” in the script, and… it works! So, the problem seems solved.
Thank you