Results 1 to 4 of 4

Thread: CloseAndDiscard in AutoCAD 2013

  1. #1
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default CloseAndDiscard in AutoCAD 2013

    In prevoius versions of AutoCAD i have closed the document with CloseAndDiscard. This is not an option in AutoCAD 2013. What do I do?

    Dim doc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
    Try
    Dim db As Autodesk.AutoCAD.DatabaseServices.Database = doc.Database
    If FileName_N_Path = General.BrAs.NotSet Then db.Save() Else db.SaveAs(FileName_N_Path, db.OriginalFileVersion)
    doc.CloseAndDiscard()
    Catch ex As Exception
    End Try
    doc = Nothing

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: CloseAndDiscard in AutoCAD 2013

    You can still use it. It is now an extension method.
    C:> ED WORKING....

  3. #3
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: CloseAndDiscard in AutoCAD 2013

    what do you mean by extension method?

    doc.CloseAndDiscard gives me an error in Visual Studio

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: CloseAndDiscard in AutoCAD 2013

    Extension Method from MSDN. The CloseAndDiscard method is actually part of the core now, but an extension method was created for the doc object so that you can still execute the method as if it was still part of the doc class. The Document object was moved to Autodesk.AutoCAD.ApplicationServices.Document and the CloseAndDiscard method was moved to Autodesk.AutoCAD.ApplicationServices.DocumentExtension.


    Are you migrating a 2012 or earlier project? If so, have you added a reference to the core, acCoreMgd? Have you added a Imports statement for ApplicationServices?

    You might also want to see the Migration Guide in arxmgd.chm.
    C:> ED WORKING....

Similar Threads

  1. Autocad 2013
    By Swapnil in forum AutoLISP
    Replies: 1
    Last Post: 2014-01-03, 01:56 PM
  2. 2013: Autocad 2013
    By Swapnil in forum AutoCAD General
    Replies: 1
    Last Post: 2013-12-30, 11:35 AM
  3. AutoCAD (Structural Detailing / AutoCAD 2013) Content
    By rfaMOWENS in forum AutoCAD Structural Detailing
    Replies: 1
    Last Post: 2013-07-04, 06:04 AM
  4. Sharing files between Autocad 2013 LT and Autocad 2013
    By ksnyyfan2341090 in forum AutoCAD General
    Replies: 1
    Last Post: 2013-04-25, 01:25 AM
  5. 2013: AutoCAD 2013 - DWG to PDF
    By hcadang in forum AutoCAD Plotting
    Replies: 8
    Last Post: 2012-12-27, 04:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •