Batch Export C++


#1

Hi,

I would appreciate some help in the certain task I want to do. It is a relatively simple problem that I would normally approach with RhinoApp().RunScript…but here is the task and the question:

Task: (Batch) export every object in the Rhino file to a separate.obj file together with the.mtl file (textures)

Question: If RunScript is the best way to do this then how would that look for this task? How to attach mtl files to the obj ones? Can this be done on a “lower level” programmatically?

Thanks!
Milos


(Dale Fugier) #2

Hi Milos,

Yes

No, there is no SDK access to Rhino’s OBJ exporter.

– Dale


#3

Hi Dale,

thanks for clarifying it. But I still dont get the way to do it with RunScript…how to export to .obj and particulary how to check the !Save Textures" box in the dialog automatically… Could you maybe give me an example of how this line of code looks like?

RhinoApp().RunScript(L"_Export…?

Thanks!


(Steve Baer) #4

@dale , Tim did write the V6 Obj exporter in RhinoCommon. I don’t think it will work for this case, but just thought you would like to know.


#5

Hi,

thanks for the info Steve…you are right, in this case it wont help cause I prefer C++ and need it for V5. I would really really appreciate the advice on how that RunScript line of code looks like…

thanks!


(Dale Fugier) #6

Hi Milos,

Let me know if the attached sample is helpful.

– Dale

cmdTestMilos.cpp (3.0 KB)