Rhino saves file then (annoyingly) prompts to save file

I have created a 3D dxf file from Excel inputs… It has one annoying issue – it prompts to save the file (but the script has already saved. I have to press the “N” key repeatedly to resolve issue. Is it possible for someone to tell me what I am doing improperly?

Peter

Here is a portion of the code:

save the file

    save(partName)
    #clearworkspace()
    # remove rectangle (as quicker and easier than doing "new file")
    rs.DeleteObject(createdObj) 

def save(fn):
fName= fn + ".DXF"
cmd = “_-Save " + chr(34)+DXFPATH+fName+chr(34)+ " Enter"
print “Savecommand:”, cmd
print “save=”,rs.Command( cmd,echo=dBGFLAG)
def clearworkspace():
cmd = "
-New _None” + " _Enter"
print “New command:”, cmd
print “new=”, rs.Command( cmd,echo=dBGFLAG)

@Peter2,

before opening the new empty document, put this line in your script:

rs.DocumentModified(False)

note what the python help states about this method.

c.

1 Like

Line of code entered and job runs to completion. So many thanks

Peter