C++
Acad::ErrorStatus acedSyncFileOpen( const ACHAR * pszFileToOpen, const wchar_t* wszPassword = NULL );
File
aced.h
Description
This function opens the drawing file specified by pszFileToOpen and loads it into the AutoCAD editor in much the same way as the AutoCAD OPEN command, but without the user interface. If pszFileToOpen does not point to a valid DWG file, the function issues a prompt to that effect and displays the standard Select File dialog.
acedSyncFileOpen() works only in SDI mode. In MDI mode, it returns eNotApplicable.
If the file is already open in another AutoCAD session, acedSyncFileOpen() offers the option to open the file as read-only. Depending on the response, it either opens the file as read-only or displays the standard Select File dialog.
If the file is a valid DWG, acedSyncFileOpen() opens the file in AutoCAD and returns Acad::eOk. This function does not return until the loading of the drawing into the editor is complete.
If wszPassword is null, the user is prompted for a password if one is required and if no applicable password exists in the password cache.
If at any time the Select File dialog is dismissed with Cancel, acedSyncFileOpen() returns Acad::eFilerError.
Parameters
Parameters | Description |
---|---|
pszFileToOpen | Input path/file name or URL of the drawing file to open |
wszPassword | Input pointer to a "wide-char" string containing a password |