Results 1 to 8 of 8

Thread: Dimension standard changes on drawing close

  1. #1
    Member
    Join Date
    2020-05
    Posts
    7
    Login to Give a bone
    0

    Default Dimension standard changes on drawing close

    I have a VBA routine that that opens a template drawing and modifies and saves the drawing. The template Dimension Standard is "ANSI". After the drawing has been modified and saved the Dimension Standard is still "ANSI". However, after the drawing is closed and then reopened I get a dialog box that the drawing has one or more errors do I want to recover? If I say No then the drawing opens normally but the Dimension Standard is now "ISO" and I have no associated dimstyles. Changing the Dimension Standard to "ANSI" and saving eliminates the error. I'm at a loos to know what is causing this, It only happens with drawings that have been generated with the VBA routine.

  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: Dimension standard changes on drawing close

    Welcome to AUGI. Post your code so we can help you. In the reply window, click on Go Advanced and use the code tags button to wrap your code.
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2020-05
    Posts
    7
    Login to Give a bone
    0

    Default Re: Dimension standard changes on drawing close

    Code:
    'Load template drawing if required
       
       If TempDwg <> "" Then
            Set objDoc = Application.Documents.Open(drive & TmplDwgPath & TempDwg, True)
       End If
    .
    .
    .
    .
    If Save = True Then
        DlFilename = drive & Path1 & Folder & DwgPath & SaveAsDwg.Dwg_Name.Text
        NewDwgExst = DlFilename & ".dwg"
        
        
        If Dir(NewDwgExst) <> "" Then
            SaveExst = MsgBox("Drawing Already Exists.  Overwrite?", vbYesNo)
            If SaveExst = vbNo Then
                GoTo saveDwg:
            End If
        End If
        
        ThisDrawing.SaveAs (DlFilename)
        Unload SaveAsDwg
        
    Else
    
        Unload SaveAsDwg
        
    End If

    What I have found is the problem only occurs with drawings that have been created with the VBA routine and are being saved as an earlier version of AutoCad. Until the drawing is closed the "AM Options\dimension standard" remains as "ANSI" even if it is saved again. Only when the drawing is closed and reopened does the "AM Options\Dimension Standard" change to "ISO". This does not seem to change if the drawing is saved as the same version of AutoCad that it was created in.
    Last edited by Ed Jobe; 2020-06-02 at 01:59 PM.

  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: Dimension standard changes on drawing close

    There's not very much here to go on.

    What does your Unload function do?
    There's nothing that saves as a previous version.
    Where is the option being changed?
    What are the errors being reported?
    C:> ED WORKING....

  5. #5
    Member
    Join Date
    2020-05
    Posts
    7
    Login to Give a bone
    0

    Default Re: Dimension standard changes on drawing close

    The unload function unloads a form/menu that allows the user to enter a drawing name.
    Our AutoCad is setup under "Options/Open and Save" to save as AutoCad mechanical 2013 Drawing (*dwg)
    The option being changed is "Options/AM Standards". The "Standard" is being changed from "ANSI" to "ISO".

    The error that I receive is: "One error was found in the drawing file during open. Would you like to cancel this open? It is recommended you cancel the open and then run the RECOVER command on the drawing file"
    Recover does nothing and the error remains until the "ISO" is changed to "ANSI"

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

    Default Re: Dimension standard changes on drawing close

    I assume AM stands for AutoCAD Mechanical? I don't have that, but I am familiar with setting options. Can you show your code?

    I'm not sure that the Save method respects your choice in options to save to earlier version. I think you need to use the FileType option of the SaveAs method to specify what version to save to.
    Last edited by Ed Jobe; 2020-06-02 at 10:14 PM.
    C:> ED WORKING....

  7. #7
    Member
    Join Date
    2020-05
    Posts
    7
    Login to Give a bone
    0

    Default Re: Dimension standard changes on drawing close

    I have no code for setting options, all of the options are set when AutoCAD opens and I am not changing any of these.

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

    Default Re: Dimension standard changes on drawing close

    I still don't see anything in the code you posted that modifies the dwg. Saving wouldn't do it. Can you post a dvb and sample dwg that I can test? Perhaps there is something wrong with the template.
    C:> ED WORKING....

Similar Threads

  1. Replies: 7
    Last Post: 2018-04-13, 03:57 AM
  2. Close Revit without saving changes?
    By scowsert in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 1
    Last Post: 2007-06-22, 05:08 PM
  3. Close Revit without saving changes?
    By scowsert in forum Revit Architecture - General
    Replies: 1
    Last Post: 2007-06-22, 05:08 PM
  4. Close a file and don't save changes
    By jgardner.79905 in forum AutoLISP
    Replies: 4
    Last Post: 2006-08-21, 05:31 PM
  5. How do I close the file *without* saving changes?
    By iru69 in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 6
    Last Post: 2005-06-23, 03:40 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
  •