DatabaseReadDwgFile(String,
FileShare, Boolean, String) Method
|
Reads the contents of the specified file into
this database object.
Namespace: Teigha.DatabaseServices
Assembly: TD_Mgd (in TD_Mgd.dll) Version:
24.2.0.0
Syntax
public void ReadDwgFile(
string fileName,
FileShare fileSharing,
bool allowCPConversion,
string password
)
Public Sub ReadDwgFile (
fileName As String,
fileSharing As FileShare,
allowCPConversion As Boolean,
password As String
)
public:
void ReadDwgFile(
String^ fileName,
FileShare fileSharing,
bool allowCPConversion,
String^ password
)
member ReadDwgFile :
fileName : string *
fileSharing : FileShare *
allowCPConversion : bool *
password : string -> unit
Parameters
- fileName String
- [in] Path to the file to read.
- fileSharing FileShare
- [in] Share mode.
- allowCPConversion Boolean
- [in] Flag that specifies whether to allow codepage
conversion.
- password String
- [in] String containing a .dwg password.
Remarks
Pieces of the
drawing are read in only as needed. So, the drawing file is left
open until the database object is deleted, at which point the
database destructor closes the drawing file. It always tries to
open files with read access. It fails if read access is not
available. The fileSharing parameter describes how other
applications can access the file when the same file has already
been opened.
Mode |
Description |
_SH_DENYWR |
Opens an existing file as read-only. Denies write-access to the
file by other sessions. |
_SH_DENYRW |
Opens a file for reading and writing. Denies read-write access
to the file by other sessions. |
_SH_DENYNO |
Opens an existing file as read-only. Permits read-write access
to the file by other sessions. |
The allowCPConversion argument controls the behavior when the user
tries to read a .dwg file where the NLS files are not available to
convert from the codepage of the drawing to the codepage of the
system (for example, a Japanese drawing on an English OS). If
allowCPConversion is false, you are prompted to use a default
conversion which might cause data loss. If allowCPConversion is
true, the file opens and the conversion happens silently. If
password is NULL, the user is prompted for a password if one is
required and if no applicable password exists in the password
cache. This method should only be used on a newly created database
that was created with its constructor's buildDefaultDrawing
argument set to false. If this method is used on a database that
was created with buildDefaultDrawing set to true, or a database
that already has information in it, memory leaks occur.
See Also