Delphi 7 -- AutoCAD 2005 SaveAs Error

Discussion in 'AutoCAD' started by Jackrabbit, Oct 5, 2004.

  1. Jackrabbit

    Jackrabbit Guest

    Code worked in AutoCAD 2000. Upgraded to AutoCAD 2005 last week and now I get an "Unexpected Server Error" sometimes -- sometimes not.

    Any ideas what could be wrong?

    [pre]
    procedure SaveDrawing(Drawing: AcadDocument);
    var
    FileName: string;
    begin
    Drawing.PurgeAll;
    Drawing.Regen(acAllViewports);
    FileName := GetFilePath(DwgInfoForm.AutocadMasterFileEditBox.Text) +
    RightStr(DwgInfoForm.DrawingNumberEditBox.Text, 6);
    if SheetNumber < 10 then
    begin
    FileName := FileName + '0' + IntToStr(SheetNumber) + '.dwg';
    end
    else
    begin
    FileName := FileName + IntToStr(SheetNumber) + '.dwg';
    end;
    Drawing.SaveAs(FileName, acNative, EmptyParam); // Stops on this line ******
    //Drawing.Close(False, EmptyParam);
    end;
    [/pre]
     
    Jackrabbit, Oct 5, 2004
    #1
  2. Hi Jackrabbit,

    I don't speak Delphi 7, but as a suggestion I would check if the filename is
    valid. Plus I don't see where you put a value in EmptyParam. Could it be
    that ?

    Gilles

    get an "Unexpected Server Error" sometimes -- sometimes not.
     
    Gilles Plante, Oct 7, 2004
    #2
  3. Jackrabbit

    Jackrabbit Guest

    Filenames are valid. EmptyParm is a "placeholder", if you will, for an optional parameter. It's pre-defined in Delphi, which requires that you always pass a parameter, whether it's optional or not, to an OLE server.

    I'm beginning to wonder if it has anything to do with the network version of AutoCAD. Our Acad2000 systems were all standalone versions. When we upgraded, we went with a network license version. Does AutoCAD go out and check for a valid license everytime a SAVE command is issued?

    Thanks anyway for the thoughts...
     
    Jackrabbit, Oct 7, 2004
    #3
  4. AutoCAD checks that the licence server is still running on a regular basis,
    I think it is every 15 minutes.

    The network version should work as fine as the standalone version. Are you
    saving-as on a network drive when the problem arises ? If yes, try to save
    locally to see if it does better. One other thought: was the AV software
    disabled when AutoCAD was installed ?

    Gilles

    optional parameter. It's pre-defined in Delphi, which requires that you
    always pass a parameter, whether it's optional or not, to an OLE server.
    of AutoCAD. Our Acad2000 systems were all standalone versions. When we
    upgraded, we went with a network license version. Does AutoCAD go out and
    check for a valid license everytime a SAVE command is issued?
     
    Gilles Plante, Oct 8, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.