Results 1 to 2 of 2

Thread: Map 2007 - Save Back with VB.NET

  1. #1
    Member
    Join Date
    2008-02
    Posts
    2
    Login to Give a bone
    0

    Wink Map 2007 - Save Back with VB.NET

    Trying to impliment a "save back" to attached drawings in the VB.NET API.

    From what little documentation is available the procedure should be:

    Foreach dwg in attacheddrawings...

    dwg.LockForWrite(false)
    dwg.CloneBack()
    dwg.Save
    dwg.UnlockForWrite()


    When we do this we get an MapException error on the CloneBack method call. We tried this with CloneBackArea and get the same error.

    We contacted Autodesk ADN tech support and they admit there is a problem with CloneBackArea but that CloneBack is working fine. But we have yet to have CloneBack or CloneBackArea work at all.

    In the past in AutoLISP we used ade_saveobjs call to save queried/modified object back to the dwgs and also newly created objects by area. We are trying to replace all AutoLISP code with VB.NET to move forward to future versions of AutoCAD Map.

    Thanks,

    Paul L. Smith
    Last edited by plsmith.161671; 2008-02-28 at 10:48 PM.

  2. #2
    Member
    Join Date
    2008-02
    Posts
    2
    Login to Give a bone
    0

    Default Re: Map 2007 - Save Back with VB.NET

    OK, after doing more trial and error, (lots of errors) it turns out hat CloneBack will generate a MapException error if that drawing the CloneBack method is being used on does NOT contain any entities to be written back to the attached drawing. By using GetNumInSaveSet method to return the number of modified or erased entities that are in the attached drawing and only calling CloneBack when the count is > 0.

    The correct sequence for saving back to the attached drawings is slightly different than what was shown in my prior post above.

    for each drawing in the drawing set...
    1. use the method "GetNumInSaveSet" to determine if there are entities that are in the saveset and in the drawing. If there are then:
    2. call AttachedDrawing.Lock(false) to lock the drawing file.
    3. call AttachedDrawing.CloneBack to "write" the changes to the attached drawing.
    4. call AttachedDrawing.Save to commit the changes to the attached drawing.
    5. Call AttachedDrawing.Unlock to unlock the drawing file.

    Autodesk is currently researching a "work-around" for the clonebackarea method for newly created entities that would fall with in the drawing's save back area extents.

Similar Threads

  1. Refedit cannot save changes back...
    By moshira_hassan in forum AutoCAD General
    Replies: 10
    Last Post: 2015-04-10, 04:16 AM
  2. 2015: Save back to 2007
    By tim_newsome in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2014-09-29, 03:17 PM
  3. Save back to Civil 3D 2007
    By Coolmo in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2008-02-07, 08:56 PM
  4. Save idw R9 back to R8
    By Ron Oldenbeuving in forum Inventor - General
    Replies: 0
    Last Post: 2005-02-24, 11:51 PM
  5. Save back to 6.0 (or 5.1, etc.)
    By Dean Camlin in forum Revit Architecture - Wish List
    Replies: 25
    Last Post: 2004-03-19, 05:37 PM

Posting Permissions

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