DatabaseReadDwgFile(String, FileShare, Boolean, String, Boolean) 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,
        bool bPartialLoad
)

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.
bPartialLoad  Boolean
[in] Flag that specifies whether to perform partial loading of a file.
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. The bPartialLoad flag is optimal for use when you load large drawings and plan to work only with a small part of a drawing. This option can help save resources and time dedicated to vectorizing the file content compared to a normal loading model where all objects are loaded. Over time, some objects may be loaded and vectorized as needed which can cause slight freezes while working with a drawing.
See Also

©  Bricsys NV. All rights reserved.