SaveAsType Property (ActiveX)

Specifies the drawing type for saving the drawing.

Supported platforms: Windows only

Signature

VBA:

object.SaveAsType
object

Type: PreferencesOpenSave

The object this property applies to.

Property Value

Read-only: No

Type: acSaveAsType enum

Remarks

The initial value for this property is ac2013_dwg. The following values are obsolete:

Examples

VBA:

Sub Example_SaveAsType()
    ' This example reads and modifies the preference value that controls
    ' the drawing type to save the drawing as.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesOpenSave
    Dim originalValue As Variant, DisplayValue As String
    
    ' Get the OpenSave preferences object
    Set ACADPref = ThisDrawing.Application.Preferences.OpenSave
    
    ' Store current setting
    originalValue = ACADPref.SaveAsType
    
    ' Read and display the original value
    GoSub GETVALUE
    MsgBox "The SaveAsType preference is: " & DisplayValue

    ' Modify the SaveAsType preference by changing it to AutoCAD 2000 DWG
    ACADPref.SaveAsType = ac2000_dwg
    GoSub GETVALUE
    MsgBox "The SaveAsType preference has been set to: " & DisplayValue

    ' Reset the preference back to its original value
    '
    ' Comment out this last section to leave the change to
    '         the preference in effect
    ACADPref.SaveAsType = originalValue
    
    GoSub GETVALUE
    MsgBox "The SaveAsType preference was reset back to: " & DisplayValue
    
    Exit Sub
    
GETVALUE:
    ' Convert the value of this setting to a meaningful text string
    DisplayValue = ACADPref.SaveAsType
    Select Case DisplayValue
        Case ac2000_dwg:  DisplayValue = "AutoCAD 2000 DWG (*.dwg)"
        Case acR15_dwg:  DisplayValue = "AutoCAD 2000 DWG (*.dwg)"
        Case ac2000_dxf:  DisplayValue = "AutoCAD 2000 DXF (*.dxf)"
        Case acR15_dxf:  DisplayValue = "AutoCAD 2000 DXF (*.dxf)"
        Case ac2000_Template: DisplayValue = "AutoCAD 2000 Drawing Template File (*.dwt)"

        Case ac2004_dwg:  DisplayValue = "AutoCAD 2004 DWG (*.dwg)"
        Case acR18_dwg:  DisplayValue = "AutoCAD 2004 DWG (*.dwg)"
        Case ac2004_dxf:  DisplayValue = "AutoCAD 2004 DXF (*.dxf)"
        Case acR18_dxf:  DisplayValue = "AutoCAD 2004 DXF (*.dxf)"
        Case ac2004_Template: DisplayValue = "AutoCAD 2004 Drawing Template File (*.dwt)"

        Case ac2007_dwg:  DisplayValue = "AutoCAD 2007 DWG (*.dwg)"
        Case ac2007_dxf:  DisplayValue = "AutoCAD 2007 DXF (*.dxf)"
        Case ac2007_Template: DisplayValue = "AutoCAD 2007 Drawing Template File (*.dwt)"

        Case ac2010_dwg:  DisplayValue = "AutoCAD 2010 DWG (*.dwg)"
        Case ac2010_dxf:  DisplayValue = "AutoCAD 2010 DXF (*.dxf)"
        Case ac2010_Template: DisplayValue = "AutoCAD 2010 Drawing Template File (*.dwt)"

        Case ac2013_dwg:  DisplayValue = "AutoCAD 2013 DWG (*.dwg)"
        Case ac2013_dxf:  DisplayValue = "AutoCAD 2013 DXF (*.dxf)"
        Case ac2013_Template: DisplayValue = "AutoCAD 2013 Drawing Template File (*.dwt)"

        Case acR12_dxf:  DisplayValue = "AutoCAD R12 DXF (*.dxf)"

        Case acR13_dwg:  DisplayValue = "AutoCAD R13 DWG (*.dwg)"
        Case acR13_dxf:  DisplayValue = "AutoCAD R13 DXF (*.dxf)"

        Case acR14_dwg:  DisplayValue = "AutoCAD R14 DWG (*.dwg)"
        Case acR14_dxf:  DisplayValue = "AutoCAD R14 DXF (*.dxf)"
        Case acNative:   DisplayValue = "Latest drawing release"
        Case acUnknown:  DisplayValue = "The drawing type is unknown"
    End Select
    
    Return
End Sub

Visual LISP:

(defun c:Example_SaveAsType()
    ;; This example reads and modifies the preference value that controls
    ;; the drawing type to save the drawing as.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Store current setting
    (setq originalValue (vla-get-SaveAsType (vla-get-OpenSave preferences)))
    
    ;; Read and display the original value
    (setq DisplayValue (SaveAsTypeMsg (vla-get-SaveAsType (vla-get-OpenSave preferences))))

    (alert (strcat "The SaveAsType preference is: " DisplayValue))

    ;; Modify the SaveAsType preference by changing it to AutoCAD 2000 DWG
    (vla-put-SaveAsType (vla-get-OpenSave preferences) ac2000_dwg)
  
    (setq DisplayValue (SaveAsTypeMsg (vla-get-SaveAsType (vla-get-OpenSave preferences))))

    (alert (strcat "The SaveAsType preference has been set to: " DisplayValue))

    ;; Reset the preference back to its original value
    ;;
    ;; Comment out this last section to leave the change to
    ;;         the preference in effect
    (vla-put-SaveAsType (vla-get-OpenSave preferences) originalValue)
    
    (setq DisplayValue (SaveAsTypeMsg (vla-get-SaveAsType (vla-get-OpenSave preferences))))

    (alert (strcat "The SaveAsType preference was reset back to: " DisplayValue))
)

(defun SaveAsTypeMsg (DisplayValue / )
  
    ;; Convert the value of this setting to a meaningful text string  
    (cond
        ((or (= DisplayValue ac2000_dwg)
             (= DisplayValue acR15_dwg)) (setq DisplayValue "AutoCAD 2000 DWG (*.dwg)"))
        ((or (= DisplayValue ac2000_dxf)
             (= DisplayValue acR15_dxf)) (setq DisplayValue "AutoCAD 2000 DXF (*.dxf)"))
        ((= DisplayValue ac2000_Template) (setq DisplayValue "AutoCAD 2000 Drawing Template File (*.dwt)"))

        ((or (= DisplayValue ac2004_dwg)
             (= DisplayValue acR18_dwg)) (setq DisplayValue "AutoCAD 2004 DWG (*.dwg)"))
        ((or (= DisplayValue ac2004_dxf)
             (= DisplayValue acR18_dxf)) (setq DisplayValue "AutoCAD 2004 DXF (*.dxf)"))
        ((= DisplayValue ac2004_Template) (setq DisplayValue "AutoCAD 2004 Drawing Template File (*.dwt)"))

        ((= DisplayValue ac2007_dwg) (setq DisplayValue "AutoCAD 2007 DWG (*.dwg)"))
        ((= DisplayValue ac2007_dxf) (setq DisplayValue "AutoCAD 2007 DXF (*.dxf)"))
        ((= DisplayValue ac2007_Template) (setq DisplayValue "AutoCAD 2007 Drawing Template File (*.dwt)"))

        ((= DisplayValue ac2010_dwg) (setq DisplayValue "AutoCAD 2010 DWG (*.dwg)"))
        ((= DisplayValue ac2010_dxf) (setq DisplayValue "AutoCAD 2010 DXF (*.dxf)"))
        ((= DisplayValue ac2010_Template) (setq DisplayValue "AutoCAD 2010 Drawing Template File (*.dwt)"))

        ((= DisplayValue ac2013_dwg) (setq DisplayValue "AutoCAD 2013 DWG (*.dwg)"))
        ((= DisplayValue ac2013_dxf) (setq DisplayValue "AutoCAD 2013 DXF (*.dxf)"))
        ((= DisplayValue ac2013_Template) (setq DisplayValue "AutoCAD 2013 Drawing Template File (*.dwt)"))

        ((= DisplayValue acR12_dxf) (setq DisplayValue "AutoCAD R12 DXF (*.dxf)"))

        ((= DisplayValue acR13_dwg) (setq DisplayValue "AutoCAD R13 DWG (*.dwg)"))
        ((= DisplayValue acR13_dxf) (setq DisplayValue "AutoCAD R13 DXF (*.dxf)"))

        ((= DisplayValue acR14_dwg) (setq DisplayValue "AutoCAD R14 DWG (*.dwg)"))
        ((= DisplayValue acR14_dxf) (setq DisplayValue "AutoCAD R14 DXF (*.dxf)"))

        ((= DisplayValue acNative) (setq DisplayValue "Latest drawing release"))
        ((= DisplayValue acUnknown) (setq DisplayValue "The drawing type is unknown"))
    )
  
  DisplayValue
)