Opens an existing drawing file (DWG) and makes it the active document.
Supported platforms: Windows only
Signature
VBA:
RetVal = object.Open(Name [, ReadOnly] [, Password])
- object
-
The objects this method applies to.
- Name
-
Access: Input-only
Type: String
The full path and file name, or a valid URL address, of the drawing file to open. If the drawing is in the folder specified by the SupportPath property, then the path is not needed and the file name is sufficient.
- ReadOnly (Documents only)
-
Access: Input-only; optional
Type: Variant
The default setting is False.
- True: Opens the drawing as a read-only drawing.
- False: Opens the drawing as a read-write drawing.
- Password
-
Access: Input-only; optional
Type: Variant
Password to open an encrypted drawing.
Return Value (RetVal)
Type: Document
The Document object that represents the opened drawing file.
Remarks
It is recommended that you save the current drawing before calling this method.
This method opens AutoCAD drawing files only. Use the Import method to open SAT, EPS, DXF, WMF, or BMP format files.
When working in MDI mode, you should always use the Open method from the Documents collection.
When accessing a secure URL, a dialog box prompts the user for the necessary password information. Message boxes appear if the user has not suppressed this activity in the browser.
When downloading a file, AutoCAD creates a temporary file for internal processing. Do not attempt to access this temporary file. Information in this file is deleted at the end of the AutoCAD session.
Examples
VBA:
Sub Example_Open() ' The following example opens "C:\AutoCAD\Sample\city map.dwg" file. ' This drawing may not exist on your system. Change the drawing ' path and name to reflect a valid AutoCAD drawing on your system. If AcadApplication.Preferences.System.SingleDocumentMode = True Then ThisDrawing.Open "C:\AutoCAD\Sample\city map.dwg" Else ThisDrawing.Application.Documents.Open "C:\AutoCAD\Sample\city map.dwg" End If End Sub
Visual LISP:
Not available