MKI_ENTITY_ENUM (Entity Classes) Changed in Version 2023.0

www.CAD6.com

C++ Syntax

class MKI_ENTITY_ENUM

{

  public:

 

  MKI_ENTITY_ENUM( void );

 

  ~MKI_ENTITY_ENUM();

 

  bool

  IsValid( void ) const;

 

  MKI_ENTITY_PTR

  Reset( MKI_CONST_ENTITY_PTR f_pEntity, __int32 f_nFlag1, __int32 f_nFlag2, bool f_fValid, __int32 f_nEnumMode );

 

  MKI_ENTITY_PTR

  GetFirst( __int32 f_nListIndex, __int32 f_nFlag1, __int32 f_nFlag2, bool f_fValid, __int32 f_nEnumMode );

 

  MKI_ENTITY_PTR

  GetNext( MKI_CONST_ENTITY_PTR f_pEntity );

 

  MKI_ENTITY_PTR

  GetLast( __int32 f_nListIndex, __int32 f_nFlag1, __int32 f_nFlag2, bool f_fValid, __int32 f_nEnumMode );

 

  MKI_ENTITY_PTR

  GetPrevious( MKI_CONST_ENTITY_PTR f_pEntity );

};

 

This structure is used to enumerate entity list contents.

 

Example 1

MKI_ENTITY_ENUM cEnum;

 

if( MKI_ENTITY_PTR pEntity = cEnum.GetFirst( MKI_ENTITIYLIST_ENTITIES, MKI_FLAG_USE, MKI_FLAG_USE, true ) )

{

  do

  {

 

    // Do something with pEntity here

 

  }

  while( cEnum.GetNext( pEntity );

}

 

This example runs through all entities in the current drawing's entity list that are selected (flag MKI_FLAG_USE is set) and "valid" according to the current undo state.

 

Example 2

MKI_ENTITY_ENUM cEnum;

 

if( MKI_ENTITY_PTR pEntity = cEnum.GetFirst( MKI_ENTITIYLIST_BLOCKS, 0, 0, false ) )

{

  do

  {

 

    // Do something with pEntity here

 

  }

  while( cEnum.GetNext( pEntity );

}

 

This example runs through all entities in the current drawing's block list regardless of whether they are "valid" or not.

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH