MKI_BlockFastInsert (Entity Creation) Changed in Version 2022.2

www.CAD6.com

C++ Syntax

MKI_ENTITY_BLOCK_PTR

MKI_BlockFastInsert(

 const LPCWSTR f_pLibraryName,

 bool f_fBoosted );

 

This procedure terminates a currently opened provisional block (see MKI_BlockOpen) and inserts it to the block memory list of the drawing or to a library.

 

Parameters

f_pszLibraryName

[const LPCWSTR] Name of the library the block shall be inserted to. If the library name is MKI_BLOCK_ID, the block will be added to the drawing's block memory list.

f_fBoosted

[bool] If true and the block was inserted to the internal drawing block memory list, the block will be inserted only preliminary, i.e. without updating the internal block list and its flags. To finalize the insertion(s), you must call MKI_BlockUpdateList once you're finished creating blocks. This will significantly speed up the creation of a huge number of blocks at once.

 

Return Value

Returns the address of the inserted block. Returns nullptr if the insertion was not successful, normally due to insufficient memory, or if another block with the same name already exists.

 

Regardless of the result, the provisional block is closed afterwards (either because it was not open to start with, or because it was just closed before trying to insert it).

 

Comment

This procedure is a kind of macro that executes steps similar to the following code segment:

 

MKI_BlockAddEnd();

MKI_ENTITY_BLOCK_PTR pNewEntity = MKI_BlockInsert( f_pszLibraryName, f_fBoosted );

MKI_BlockClose();

return( pNewEntity );

 

This causes the provisional block to be terminated, initialized and then inserted to the drawing or a library. Afterwards, it is closed. For a detailed description, see the referenced procedure's descriptions.

 

If possible, you should use this command instead of calling the separate procedures to increase speed and to reduce code size.

 

CAD6interface 2025.1 - Copyright 2025 Malz++Kassner® GmbH