R7 Problems exporting stl using rhinoscript/python

hi there,

i am often exporting via python- /rhinoscript a lot of breps automaticaly as stl due to a necessary Workflow. Since R7 i kind of can not prevent Rhino from asking me this Dialog:

Choose STL option ( ExportFileAs=Binary ExportUnfinishedObjects=Yes UseSimpleDialog=No )

I tried to deactivate it by telling Rhino always to use the same options but it keeps on asking me this for each geometry. Am i missing something ?

Here`s my code:

            mid = sc.doc.Objects.AddMesh(mobj)
            rs.UnselectAllObjects()
            rs.SelectObjects(mid)
            cmd = '_-Export "{}" _enter'.format(file_path)
            rs.Command(cmd)
            sc.doc.Objects.Delete(mid,True)

Thanks for the help

Hmm, my V6 compatible stl export scripts seem to run OK in V7 in a couple of tests… Mine are pretty detailed with all the options spelled out though, I’ll have to check further, I am in the process of going through a lot of this stuff now.

I can understand. Dont get me wrong.. the export is working perfectly its just the dialog that is annoying

Yes, that’s what I mean, I don’t have any problems bypassing the dialog… I’ll check later if someone doesn’t before me.

Hey,

i kind of found the solution. So there seems to be a second dialog in R7 now.
The first is asking for the “STL Options” the second Dialog is asking for the “meshing options”.
So simply adding a second “_enter” seems to be a good workaround.

But i don`t get the point why Rhino is asking for “Meshing options” when the mesh is already generated ?

Thanks anyway for your effort.

I am having a similar issue, the script was working in previous rhino but now in rhino 7 exports only empty .stls (0 kb)

rs.SelectObject(nowObj)
print nowObj
nowName = str(nowLayer)
nowName = nowName.replace(":", "-")
nowName = nowName.replace(" ", "_")
exportPath = filePath + nowName + ".stp"

Rhino.RhinoApp.RunScript("-_Export " + str(exportPath) +" Enter"+" Enter", False)
Rhino.RhinoApp.RunScript("-_SelNone", False)
rs.DeleteObject(nowObj)
usedLayers.append(nowLayer)

print output for example is (are closed object polysurfaces) :
ff6af33c-bdf2-46cd-bb4e-d6ecbab7a080
33cde126-d2ba-4b76-b6a7-07984b5b81fc

so they are objects but they don’t get to be exported in the STL file, any idea why?

I’ve replied to your original post…