I do have the following script:
import rhinoscriptsyntax as rs
import os
def AutoExportWithOrigin():
ids = rs.GetObjects("select objects to export", preselect =True)
if not ids: return
bb = rs.BoundingBox(ids, rs.CurrentView())
p1 = (bb[0]+bb[6])/2
# mIds = rs.MirrorObjects(ids, p1, p1 + rs.ViewCPlane().YAxis, True)
# rs.UnselectAllObjects()
# rs.SelectObjects(mIds)
filename = rs.SaveFileName ("Export dxf", "dxf files (*.dxf)|*.dxf||",rs.DocumentPath(),os.path.splitext(rs.DocumentName())[0])
cmdStr = "_ExportWithOrigin " + str(bb[0]) + filename + " _Enter" # orig
rs.Command(cmdStr)
# rs.DeleteObjects(mIds)
if __name__ == '__main__': AutoExportWithOrigin()
and I do try to implement an automatic file export that opens the export dialog box into the active Rhino document folder and automatically selects the .dxf file extension for export and unfortunately I do have an error:
The filename
part of the script it is implemented by me, the original script was:
cmdStr = "_ExportWithOrigin " + str(bb[0]) + " _Enter"
Please can help-me somebody to fix this issue?