MKI_PlugInImport (Callback) Renamed in Version 2015.0

www.CAD6.com

C++ Syntax

__int32

MKI_PlugInImport(

 const LPCWSTR f_pszFileName

 __int32 f_nFilterMode,

 void* f_pData );

 

typedef __int32

(*MKI_PLUGINIMPORT_PROC)(

 const LPCWSTR f_pszFileName,

 __int32 f_nFilterMode,

 void* f_pData );

 

This procedure is called each time the serving application wants to load a non-MKD drawing. The plug-in should then determine whether it can handle this file and load it if possible.

 

Parameters

f_pszFileName

[const LPCWSTR] Name of the file that contains the unknown drawing.

f_nFilterMode

[__int32] A bit-wise OR combination of special filter modes. It can be any combination of the following values:

 

MKI_FILTER_MODE_NULL

No special mode.

 

MKI_FILTER_MODE_MERGE

The drawing shall be added to the current drawing data. This is the same behavior as when importing on explicit user command. The plug-in should create its own undo level using MKI_UndoInitProcess, MKI_UndoCancelProcess and MKI_UndoFinishProcess.
If this value is not set, the drawing shall replace the current drawing data. The plug-in should call MKI_DrawingNewFile before importing the data.

 

MKI_FILTER_MODE_QUIET

The import filter shall not display any messages in case of errors. This mode is used when an unknown type of file shall be checked by the plug-in. If successful (return value MKI_IMPORT_OK), the imported data will be used. In case of error (return value MKI_IMPORT_UNKNOWN or MKI_IMPORT_ERROR), the imported data will be discarded and the next import filter will be called.

 

MKI_FILTER_MODE_AUTOCONV New in Version 2010.2

The import filter is called by the auto-converter in batch operation, i.e. it does not have to display anything on the screen after successful import. This can significantly speed up the conversion of many files at once.

f_pData New in Version 2013.0

[void*] Pointer to a set of plug-in-specific import options. Please refer to the plug-in's documentation for details (both data structure and interpretation). May be nullptr to indicate "use default options".

 

Return Value

Should return one of the following values:

 

MKI_IMPORT_OK

The plug-in knows this type of file and was able to load the file successfully.

 

MKI_IMPORT_UNKNOWN

The plug-in does not know this type of file. The serving application will ask all other filters whether they know this type of file.

 

MKI_IMPORT_ERROR

The plug-in knows this type of file, but an error occurred during the attempt to load it.

 

Comment

The name of the procedure has to be exactly MKI_PlugInImport.

 

CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH