(***************************************
   System  : - API
   Module  : LibTool
   dll     : kAPI2D5.dll

****************************************)
unit Libtool;
{$ALIGN OFF}

interface

uses
  Windows, ks2DCOM_TLB, Ltdefine;

type

  Reference = Longint;
  Double2   = Array[ 1..2 ] of Double;
  Double4   = Array[ 1..4 ] of Double;
  Double2_2 = Array[ 1..2, 1..2 ] of Double;
  PByte     = ^Byte;
  PIObject2DNotifyResult = ^IObject2DNotifyResult;
  PIParametrizationParam = ^IParametrizationParam;
  PIDispatch = ^IDispatch;

const
{$IFDEF __LIGHT_VERSION__}
  APPTOOL5 = 'klAPI2D5.DLL';
{$ELSE}
  APPTOOL5 = 'kAPI2D5.dll';
{$ENDIF}

////////////////////////////////////////////////////////////////////////////////
// Libtool.h
////////////////////////////////////////////////////////////////////////////////


//   - 2
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
function  ReturnResult : Integer; stdcall;

//   - 390
//-----------------------------------------------------------------------------
//       
//--
function ksParEllipseArc( par : PEllipseArcParam1 ) : Reference;  stdcall;

//   - 3
//-----------------------------------------------------------------------------
//    ,    .
//-----------------------------------------------------------------------------
function ResultNULL: Integer; stdcall;


//   - 4
//-----------------------------------------------------------------------------
//   ,    .
//-----------------------------------------------------------------------------
procedure  StrResult( str   : PChar;             //  
                      limit : Integer ); stdcall; //   str


//   - 791
//-----------------------------------------------------------------------------
//   ,    .
//-----------------------------------------------------------------------------
procedure  StrResultW( str   : PWideChar;          //  
                       limit : Integer ); stdcall; //   str


//   - 6
//-----------------------------------------------------------------------------
//     (HWND).
//-----------------------------------------------------------------------------
function GetHWindow : HWND; stdcall;


//   - 86
//------------------------------------------------------------------------------
//     
// ---
function ksGetWorkWindowColor : DWord; stdcall;


//   - 142
//-----------------------------------------------------------------------------
//         .
//------------------------- ----------------------------------------------------
procedure EnableTaskAccess( enable : Integer ); stdcall;// 0-, 1-


//   - 142
//-----------------------------------------------------------------------------
//   ( 1 )  ( 0 )      .
//-----------------------------------------------------------------------------
function  IsEnableTaskAccess : Integer; stdcall;


//   - 238
//-----------------------------------------------------------------------------
//   ,     .
//-----------------------------------------------------------------------------
procedure PumpWaitingMessages; stdcall;


//   - 260
//------------------------------------------------------------------------------
//    
//    Cursor, Placement    
//        
// ---
function ksSetCriticalProcess : Integer; stdcall;


//   - 141
//-----------------------------------------------------------------------------
//         .
//          
// CommandWindowCallBack.
//        NULL,   
// CommandWindow  ,     
//   .      .
//     ,    
//      FALSE.    -1.
//    commands      4.X,
//  "!_1 !_2 ..."
//         (  1),
// ..   "_1"  1.
//    commands   ,   
//     .
//-----------------------------------------------------------------------------
function  CommandWindow( info : PRequestInfo ) : Integer; //   
                         stdcall;


//   - 141
//-----------------------------------------------------------------------------
//         .
//          
// CommandWindowCallBackW.
//        NULL,   
// CommandWindowW  ,     
//   .      .
//     ,    
//      FALSE.    -1.
//    commands      4.X,
//  "!_1 !_2 ..."
//         (  1),
// ..   "_1"  1.
//    commands   ,   
//     .
//-----------------------------------------------------------------------------
function  CommandWindowW( info : PRequestInfoW ) : Integer; //   
                         stdcall;


//   -744
//-----------------------------------------------------------------------------
//      .
//       
//    CursorCallBack.
//-----------------------------------------------------------------------------
function  ksCursor( info     : PRequestInfo;        //   
		                Var x    : Double;              //   
                    Var y    : Double;
         	          phantom  : Pointer ) : Integer; //    
                    stdcall;

//   - 17
//-----------------------------------------------------------------------------
//      .
//       
//    CursorCallBack.
//-----------------------------------------------------------------------------
function  ksCursorEx( info         : PRequestInfo;  //   
              	      Var x        : Double;        //   
                      Var y        : Double;
         	            phantom      : Pointer;       //    
                      processParam : PIUnknown ):   //  
                                     Integer;  stdcall;

//   - 17
//-----------------------------------------------------------------------------
//      .
//       
//    CursorCallBack.
//-----------------------------------------------------------------------------
function  ksCursorExW( info         : PRequestInfoW; //   
              	       Var x        : Double;        //   
                       Var y        : Double;
         	             phantom      : Pointer;       //    
                       processParam : PIUnknown ):   //  
                                      Integer;  stdcall;


//   - 18
//------------------------------------------------------------------------------
//        .
//       
//    PlacementCallBack.
//------------------------------------------------------------------------------
function Placement( info      : PRequestInfo;        //   
            	      Var x     : Double;              //   
                    Var y     : Double;
	     	            Var angle : Double;              //   
	     	            phantom   : Pointer ) : Integer; //    
                    stdcall;

//   -745
//------------------------------------------------------------------------------
// [11/6/2004]
//        .
//       
//    PlacementCallBack.
//------------------------------------------------------------------------------
function PlacementEx( info         : PRequestInfo;    //   
            	        Var x        : Double;          //   
                      Var y        : Double;
	     	              Var angle    : Double;          //   
	     	              phantom      : Pointer;         //    
                      processParam : PIUnknown ):  //  
                      Integer;   stdcall;


//   -908
//------------------------------------------------------------------------------
// [11/6/2004]
//        .
//       
//    PlacementCallBackW.
//------------------------------------------------------------------------------
function PlacementExW( info         : PRequestInfoW;   //   
            	         Var x        : Double;          //   
                       Var y        : Double;
	     	               Var angle    : Double;          //   
	     	               phantom      : Pointer;         //    
                       processParam : PIUnknown ):     //  
                       Integer;   stdcall;


//   - 165
//-----------------------------------------------------------------------------
//    Cursor  Placement     
//   .       Cursor 
// Placement.       
//  .
//      Cursor    Cursor  
//  .
//  -  0 -  ,
//    0 -   Cursor  Placement.   Esc.
//   ,   ,    
// Cursor  Placement,     ,  
// Cursor  Placement.
//-----------------------------------------------------------------------------
function ksChangeObjectInLibRequest( info     :  PRequestInfo;        //        
                                     phantom  :  Pointer ) : Integer; //    
                                     stdcall;


//   - 165
//-----------------------------------------------------------------------------
//    CursorExW  PlacementExW     
//   .       CursorExW 
// PlacementExW.       
//  .
//      CursorExW    CursorExW  
//  .
//  -  0 -  ,
//    0 -   CursorExW  PlacementExW.   Esc.
//   ,   ,    
// CursorExW  PlacementExW,     ,  
// CursorExW  PlacementExW.
//-----------------------------------------------------------------------------
function ksChangeObjectInLibRequestW( info     :  PRequestInfoW;       //        
                                      phantom  :  Pointer ) : Integer; //    
                                      stdcall;


//   - 166
//-----------------------------------------------------------------------------
// :     ,    
// (Cursor  Placement).
//  1   , 0 - .
//-----------------------------------------------------------------------------
function  ksIsCursorOrPlacementDocument : Integer; stdcall;

//   - 87
//-----------------------------------------------------------------------------
//         .
//      -1,    ,  0,
//     1.
// ---
function  ksIsActiveProcessRunnig : Integer; stdcall;

//   - 166
//-----------------------------------------------------------------------------
// (show=0)  (show=1) 
//-----------------------------------------------------------------------------
function ksPhantomShowHide( show : Byte ) : Integer; stdcall;

//   - 244
//--------------------------------------------------------------------------
//   
//   1 -   ,
// 0 -       .
//--------------------------------------------------------------------------
function ksGetCursorPosition( var x,y : double;              //    ,
                              _type   : integer ) : integer; // type -    :
                                                    stdcall; // 0 -    1 -   ,

//   - 19
//------------------------------------------------------------------------------
//    .
//   (. LtDefine.h):
// scsSTOPPED_FOR_MENU_COMMAND      ( 1)    "  ".
// scsSTOPPED_FOR_SYSTEM_STOP       ( 0)   .
// scsSTOPPED_FOR_ITSELF            (-1)   SystemControlStop - .
// scsSTOPPED_FOR_START_THIS_LIB    (-2)       .
// scsSTOPPED_FOR_START_ANOTHER_LIB (-3)      .
//------------------------------------------------------------------------------
function  SystemControlStart( menuCommand : PChar  ) : Integer; //   ,
                                                       stdcall; //    
                                                                //   


//   - 912
//------------------------------------------------------------------------------
//    .
//   (. LtDefine.h):
// scsSTOPPED_FOR_MENU_COMMAND      ( 1)    "  ".
// scsSTOPPED_FOR_SYSTEM_STOP       ( 0)   .
// scsSTOPPED_FOR_ITSELF            (-1)   SystemControlStop - .
// scsSTOPPED_FOR_START_THIS_LIB    (-2)       .
// scsSTOPPED_FOR_START_ANOTHER_LIB (-3)      .
//------------------------------------------------------------------------------
function  SystemControlStartW( menuCommand : PWideChar  ) : Integer; //   ,
                                                           stdcall; //    
                                                                    //   


//   - 20
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
procedure  SystemControlStop; stdcall;


//   - 753
//-----------------------------------------------------------------------------
// 28.12.04
//   SystemControlStart  
//                                  ( 0) -   
// scsSTOPPED_FOR_ITSELF            (-1) -   SystemControlStop,     
// scsSTOPPED_FOR_START_THIS_LIB    (-2) -   ,    SystemControlStart
// scsSTOPPED_FOR_START_THIS_LIB    (-3) -    ,
//                                  (-4) - 
// ---
function ksGetSystemControlStartResult() : Integer; stdcall;


//   - 21
// ----------------------------------------------------------------------------
//        
//  .
//        .
//   reference      .
// ----------------------------------------------------------------------------
function  KeepReference( r : Reference ) : Integer; //    
                         stdcall;

//   - 125
//-----------------------------------------------------------------------------
//    ,    ,     .
//       .
//  bufSize    - newName  .
//-----------------------------------------------------------------------------
function  FullFileName( oldName  : PChar;                        //   
                        newName  : PChar;                        //     
                        bufSize  : Cardinal ) : Cardinal; stdcall;//    newName


//   - 803
//-----------------------------------------------------------------------------
//    ,    ,     .
//       .
//  bufSize    - newName  .
//-----------------------------------------------------------------------------
function  FullFileNameW( oldName  : PWideChar;                      //   
                         newName  : PWideChar;                      //     
                         bufSize  : Cardinal ) : Cardinal; stdcall; //    newName


//   - 128
//-----------------------------------------------------------------------------
//         .
//-----------------------------------------------------------------------------
function  UniqueFileName( buff    :  PChar;                        //     
                          bufSize :  Cardinal ) : Cardinal; stdcall;//   buff


//   - 913
//-----------------------------------------------------------------------------
//         .
//-----------------------------------------------------------------------------
function  UniqueFileNameW( buff    :  PWideChar;                     //     
                           bufSize :  Cardinal ) : Cardinal; stdcall;//   buff


//   - 129
//-----------------------------------------------------------------------------
//   .
//-----------------------------------------------------------------------------
procedure RemoveUniqueFile( fileName : PChar ); stdcall;


//   - 914
//-----------------------------------------------------------------------------
//   .
//-----------------------------------------------------------------------------
procedure RemoveUniqueFileW( fileName : PWideChar ); stdcall;


//   - 134
//-----------------------------------------------------------------------------
function GetRightFileName( fileName : PChar;                        //    
                           bufSize  : Cardinal ) : Cardinal; stdcall;//    fileName


//   - 915
//-----------------------------------------------------------------------------
function GetRightFileNameW( fileName : PWideChar;                     //    
                            bufSize  : Cardinal ) : Cardinal; stdcall;//    fileName


//   - 163
//---------------------------------------------------------------------------
//      
//       4 
//---------------------------------------------------------------------------
function GetTextLength( text : PChar;            // 
                        style : Word ) : Double; // , style ==0    
                        stdcall;


//   - 916
//---------------------------------------------------------------------------
//      
//       4 
//---------------------------------------------------------------------------
function GetTextLengthW( text : PWideChar;       //  
                         style : Word ) : Double; //  , style ==0    
                         stdcall;


//   - 173 kAPI2D5.dll
//---------------------------------------------------------------------------
//      
//---------------------------------------------------------------------------
function GetTextLengthFromReference( pText : Reference ) : double;  //-    ""
                                     stdcall;

//   - 194 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-      
//  sptLIBS_FILES 		-      
//  sptTEMP_FILES 	  -       
//  sptCONFIG_FILES 	-       
//  sptINI_FILE 	    -    INI- 
//   buff   NULL  sizeBuff       
//  (  0),    
//        
//      '\' (    
//   - "<drive>:\")
//------------------------------------------------------------------------------------------------
function ksSystemPath( buff     : PChar;
                       sizeBuff : Integer;
                       pathType : Integer) : Integer; stdcall;


//   - 917 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-      
//  sptLIBS_FILES 		-      
//  sptTEMP_FILES 	  -       
//  sptCONFIG_FILES 	-       
//  sptINI_FILE 	    -    INI- 
//   buff   NULL  sizeBuff       
//  (  0),    
//        
//      '\' (    
//   - "<drive>:\")
//------------------------------------------------------------------------------------------------
function ksSystemPathW( buff     : PWideChar;
                        sizeBuff : Integer;
                        pathType : Integer) : Integer; stdcall;


//   - 200 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
procedure ksGetRelativePathFromSystemPath( sourcePath   : PChar;     //   
                                           destBuff     : PChar;     //()    (    )
                                           sizeDestBuff : Integer;   // 
                                           pathType     : Integer ); //   . ksSystemPath
                                           stdcall;


//   - 918 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
procedure ksGetRelativePathFromSystemPathW( sourcePath   : PWideChar;     //   
                                            destBuff     : PWideChar;     //()    (    )
                                            sizeDestBuff : Integer;   // 
                                            pathType     : Integer ); //   . ksSystemPath
                                            stdcall;


//   - 201 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
procedure    ksGetFullPathFromSystemPath( relativePath : PChar;       //    (    )
                                          destBuff     : PChar;       // ()    
                                          sizeDestBuff : Integer;     //  
                                          pathType     : Integer );   //    . ksSystemPath
                                          stdcall;


//   - 919 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
procedure    ksGetFullPathFromSystemPathW( relativePath : PWideChar;   //    (    )
                                           destBuff     : PWideChar;   // ()    
                                           sizeDestBuff : Integer;     //  
                                           pathType     : Integer );   //    . ksSystemPath
                                           stdcall;


//   - 202 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
procedure  ksGetRelativePathFromFullPath( mainFilePath : PChar;      //     
                                          sourcePath   : PChar;      //     
                                          destBuff     : PChar;      // ()     (        )
                                          sizeDestBuff : Integer );  //  
                                          stdcall;


//   - 920 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
procedure  ksGetRelativePathFromFullPathW( mainFilePath : PWideChar;  //     
                                           sourcePath   : PWideChar;  //     
                                           destBuff     : PWideChar;  // ()     (        )
                                           sizeDestBuff : Integer );  //  
                                           stdcall;

//   - 203 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
procedure ksGetFullPathFromRelativePath( mainFilePath : PChar;        //    
                                         relativePath : PChar;        //    (        )
                                         destBuff     : PChar;        //()     
                                         sizeDestBuff : Integer );    //  
                                         stdcall;

//   - 921 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
procedure ksGetFullPathFromRelativePathW( mainFilePath : PWideChar;    //     
                                          relativePath : PWideChar;    //     (        )
                                          destBuff     : PWideChar;    // ()     
                                          sizeDestBuff : Integer );    //  
                                          stdcall;


//   - 204 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//    
//   :
//    5.4 Release 2 Build 1
//  iMajor   = 5
//  iMinor   = 4
//  iRelease = 2
//  iBuild   = 1
//        0,   
//   
//      
//------------------------------------------------------------------------------------------------
function ksGetSystemVersion( Var iMajor   : Integer;            //  
                             Var iMinor   : Integer;            //  
                             Var iRelease : Integer;            //    
                             Var iBuild   : Integer ) : DWord;  //    
                             stdcall;

//   - 205 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//     INI-    Registry
//   lpReturnedString = 0  iSize = 0,     ,
//   -     (   0)
//     = 0,          INI-,
//    Registry
//   :
//  lpSection = "Directories"
//  lpKey     = "Sys"
//   :
//  lpReturnedString = "c:\Program Files\Kompas54\Sys"
//  iSize            = 29
//------------------------------------------------------------------------------------------------
function ksGetSystemProfileString( lpSection        : PChar;              // 
                                   lpKey            : PChar;              // 
                                   lpReturnedString : PChar;              //   
                                   iSize            : Integer ) : Integer;  // 
                                   stdcall;


//   - 922 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//     INI-    Registry
//   lpReturnedString = 0  iSize = 0,     ,
//   -     (   0)
//     = 0,          INI-,
//    Registry
//   :
//  lpSection = "Directories"
//  lpKey     = "Sys"
//   :
//  lpReturnedString = "c:\Program Files\Kompas54\Sys"
//  iSize            = 29
//------------------------------------------------------------------------------------------------
function ksGetSystemProfileStringW( lpSection        : PWideChar;            //  
                                    lpKey            : PWideChar;            //  
                                    lpReturnedString : PWideChar;            //    
                                    iSize            : Integer ) : Integer;  //  
                                    stdcall;


//   - 62 kAPI2D5.dll
//----------------------------------------------------------------------------------
//     
//    ::WinHelp
//        .   
//     
//-----------------------------------------------------------------------------------
procedure ksOpenHelpFile( helpFile : PChar;        //   help-
                          command  : Cardinal;     //  help
                          iD       : Cardinal );   //   
                          stdcall;


//   - 62 kAPI2D5.dll
//----------------------------------------------------------------------------------
//     
//    ::WinHelp
//        .   
//     
//-----------------------------------------------------------------------------------
procedure ksOpenHelpFileW( helpFile : PWideChar;    //   help-
                           command  : Cardinal;     //  help
                           iD       : Cardinal );   //   
                           stdcall;


//   - 66    kAPI2D5.dll
//--------------------------------------------------------------------------
//   
// DIMENTION_OPTIONS    -  param ->  DimensionsOptions
// ARROWFILLING_OPTIONS -  param -> int  1-   0-  
// SHEET_OPTIONS        -  param ->  SheetPar   
// LENGTHUNITS_OPTIONS  -  param -> short ST_MIX_MM - , ST_MIX_SM - , ST_MIX_M - 
//--------------------------------------------------------------------------
function GetDocOptions( optionsType: Integer;             //   (    
                        param      : Pointer;             //   
                        sizePar    : Integer ) : Integer; //  
                        stdcall;

//   - 705
//------------------------------------------------------------------------------
//   
// DIMENTION_OPTIONS    -  param ->  DimensionsOptions
// ARROWFILLING_OPTIONS -  param -> int  1-   0-  
// SHEET_OPTIONS        -  param ->  SheetPar   
// LENGTHUNITS_OPTIONS  -  param -> short ST_MIX_MM - , ST_MIX_SM - , ST_MIX_M - 
// ---
function SetDocOptions( optionsType: Integer;             //   (    
                        param      : Pointer;             //   
                        sizePar    : Integer ) : Integer; //  
                        stdcall;

//   - 82    kAPI2D5.dll
//------------------------------------------------------------------------------
//   
// * param -    
// sizePar -   
// optionsType -   (    )
//    1     0   
// ---
function ksSetSysOptions( optionsType : Integer;
                          param       : Pointer;
                          sizePar     : Integer ) : Integer;
                          stdcall;

//   - 83    kAPI2D5.dll
//------------------------------------------------------------------------------
//   
// * param -    
// sizePar -   
// optionsType -   (    )
//    1     0   
// ---
function ksGetSysOptions( optionsType : Integer;
                          param       : Pointer;
                          sizePar     : Integer ) : Integer;
                          stdcall;


//   - 112  kAPI2D5.dll
//------------------------------------------------------------------------------
//    
// fileName -    (    -     Libs)
// ---
function ksExecuteLibraryCommand( fileName : PChar; command : Integer ) : Integer; stdcall;


//   - 924  kAPI2D5.dll
//------------------------------------------------------------------------------
//    
// fileName -    (    -     Libs)
// ---
function ksExecuteLibraryCommandW( fileName : PWideChar; command : Integer ) : Integer; stdcall;


//   - 434
//------------------------------------------------------------------------------
//    :      
//  1 -    0 - 
//         LIBS
// ---
function ksIsLibraryEnabled( libName : PChar ) : Integer; stdcall; //  


//   - 925
//------------------------------------------------------------------------------
//    :      
//  1 -    0 - 
//         LIBS
// ---
function ksIsLibraryEnabledW( libName : PWideChar ) : Integer; stdcall; //  


//   - 420
//------------------------------------------------------------------------------
//  
// name -  ("H7"); dimValue -  ; high, low - ;
// inMM = true - dimValue, high, low -  , 0 -     
// ---
function  ksGetQualityDefects( name : PChar; dimValue : Double;
                                   Var high : Double; Var low : Double; inMM : Byte ) : Integer;  stdcall;


//   - 926
//------------------------------------------------------------------------------
//  
// name -  ("H7"); dimValue -  ; high, low - ;
// inMM = true - dimValue, high, low -  , 0 -     
// ---
function  ksGetQualityDefectsW( name : PWideChar; dimValue : Double;
                                   Var high : Double; Var low : Double; inMM : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//    
// system - 1 -  , 0 -  
// withLimitation - 0 -   , 1 -    
//  
//      0    
// ---
function  ksCreateQualityIterator( system : Byte; withLimitation : Byte ) : Reference;  stdcall;

//------------------------------------------------------------------------------
//   
// ch = 'F' - , ch = 'N' - 
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
function  ksMoveQualityIterator( iterator : Reference; param : PQualityContensParam;
                                     inMM : Byte; ch : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//   
// ch = 'F' - , ch = 'N' - 
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
function  ksMoveQualityIteratorW( iterator : Reference; param : PQualityContensParamW;
                                      inMM : Byte; ch : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//  
// name -  
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
function  ksGetQualityContensParam( name : PChar; param : QualityContensParam;
                                    inMM : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//  
// name -  
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
function  ksGetQualityContensParamW( name : PWideChar; param : QualityContensParamW;
                                     inMM : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//    ,    dimValue   
//  
// names -    
// dimValue, high, low -   
// system - 1 -  , 0 -  
// withLimitation - 0 -   , 1 -    
//  
// ---
function  ksGetQualityNames( names : Reference; dimValue : Double; high : Double; low : Double;
                             system : Byte; withLimitation : Byte ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//   
//    ,   SystemControlStart -   
// .
//        Dll ,
//    ,     LibraryName().
//   1,     - ,  
//   .   0 -       
//      ,    
// ---
function  ksSetCurrentLibrary( libname : PChar; hModule : LongInt ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//   
//    ,   SystemControlStart -   
// .
//        Dll ,
//    ,     LibraryName().
//   1,     - ,  
//   .   0 -       
//      ,    
// ---
function  ksSetCurrentLibraryW( libname : PWideChar; hModule : LongInt ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//   src  dst     
// ---
function  ksConvertLangStr( src :PChar; dst : PChar; dstMaxLen:integer ) : Integer;  stdcall;

//   - 725
//------------------------------------------------------------------------------
//     strID  dst     
// ---
function  ksConvertLangStrEx( hInstance : LongWord;
                              strID     : LongWord;
                              dst       : PChar;
                              dstMaxLen : Integer ) : Integer; stdcall;


//------------------------------------------------------------------------------
//     strID  dst     
// ---
function  ksConvertLangStrExW( hInstance : LongWord;
                               strID     : LongWord;
                               dst       : PWideChar;
                               dstMaxLen : Integer ) : Integer; stdcall;


//------------------------------------------------------------------------------
//           
// ---
function  ksConvertLangWindow( hWnd_ : HWND ) : Integer;  stdcall;

//   - 726
//------------------------------------------------------------------------------
//           
// ---
function  ksConvertLangWindowEx( hWnd_ : HWND; hInstance : LongWord; dlgID : PChar ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//           
// ---
function  ksConvertLangWindowExW( hWnd_ : HWND; hInstance : LongWord; dlgID : PWideChar ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//       
// ---
function  ksConvertLangMenu( hMenu_ : HMENU ) : HMENU;    stdcall;

//------------------------------------------------------------------------------
//   2D  (  )
//     RectParam   
//     rect
//        
//    
//     1,   - 0.
// ---
function  ksReDrawDocPart( rect : PRectParam;    //    
                           pView : Reference ) : Integer;  stdcall;   //   2D (  )


//------------------------------------------------------------------------------
// /   .
// enable = false -  ( "  "  )
// enable = true  -   (   "  ",
//       enable = false.   
//   -    )
// ---
procedure  ksEnableUndo( enable : Byte );  stdcall;


//------------------------------------------------------------------------------
//    
// pText -    ""
//   :    TextAlign,  -1   
// ---
function ksGetTextAlign( pText : reference ) : Integer; stdcall;

//   - 282  kAPI2D5.dll
//------------------------------------------------------------------------------
//    
// pText -    ""
// align -    TextAlign
//   : 0 -   
// ---
function ksSetTextAlign( pText : reference; align : Word ) : Integer; stdcall;


//   - 282
//------------------------------------------------------------------------------
//    
// pDoc -   2D 
//   :    IObject2DNotifyResult
// ---
function ksGetObject2DNotifyResult( pDoc : Reference ) : PIObject2DNotifyResult; stdcall;

//   - 734
//-------------------------------------------------------------------------------
//     
// ---
function ksGetLookStyle : Integer; stdcall;

//   - 735
//-------------------------------------------------------------------------------
//     
// ---
function ksSetLookStyle(style : Integer) : Integer; stdcall;

//   - 743
//-----------------------------------------------------------------------------
// [26.5.04]
//    .
// ---
function ksGetExternalInterface() : PIDispatch; stdcall;

//   - 749
// [09/8/2004]
//-------------------------------------------------------------------------------
//         
//     0,   
//
// fileName -    
// w -   
// h -   
// ---
function ksCalcRasterScale( const fileName : PChar; w, h : Double ) : Double; stdcall;


//   - 749
// [09/8/2004]
//-------------------------------------------------------------------------------
//         
//     0,   
//
// fileName -    
// w -   
// h -   
// ---
function ksCalcRasterScaleW( const fileName : PWideChar; w, h : Double ) : Double; stdcall;


//   - 771
// [20/12/2005]
//------------------------------------------------------------------------------
//   3D       
// attach: 1    3D ; 0 -    3D 
//   1,        3D.
//     0
//
// ---
function ksModule3D( attach : Byte ) : Integer; stdcall;


//   - 772
// [20/12/2005]
//-------------------------------------------------------------------------------
//       3D
// ---
function ksIsModule3DActive() : Integer; stdcall;


//   - 780
// [23/10/2006]
//------------------------------------------------------------------------------
//       LPUNKNOWN API7, 3D COM, API5(Auto)
//     LPUNKNOWN API7, 3D COM, API5(Auto)
//   obj -  LPUNKNOWN API5(COM  Auto)  API7,  
//   apiNewType -   API, objNewType -   
//       0
// ---
function ksTransferInterface( obj : PIUnknown; apiNewType, objNewType : LongInt ) : PIUnknown; stdcall;


//   - 956
// [11/9/2007]
//------------------------------------------------------------------------------
//       LPUNKNOWN API7
//     obj   doc
//   obj -   
//   doc -   
//       0
// ---
function ksTransferReference( obj, doc : Reference ) : PIUnknown; stdcall;


//   - 785
// [22/11/2006]
//-----------------------------------------------------------------------------
//   
// commandID -   enum- ProcessTypeEnum  KompasCommandEnum
// post      - true -    PostMessage, false -  SendMessage
// ---
function ksExecuteKompasCommand( commandID : LongInt; post : Integer ) : Integer; stdcall;


//   - 787
// [22/11/2006]
//-----------------------------------------------------------------------------
//    
// ---
function ksIsKompasCommandEnable( commandID : LongInt ) : Integer; stdcall;


//   - 788
// [22/11/2006]
//-----------------------------------------------------------------------------
//     
// ---
function ksIsKompasCommandCheck( commandID : LongInt ) : Integer; stdcall;

//   - 789
//-----------------------------------------------------------------------------
//    0 - 
// ---
function ksFileNameCompare( fileName1, fileName2 : PChar ) : Integer; stdcall;


//   - 934
//-----------------------------------------------------------------------------
//    0 - 
// ---
function ksFileNameCompareW( fileName1, fileName2 : PWideChar ) : Integer; stdcall;


//   - 751
// [24/8/2004]
//-------------------------------------------------------------------------------
//     
// ---
function ksGetParametrizationParam : PIParametrizationParam; stdcall;

//   - 740
// [24/8/2004]
//-----------------------------------------------------------------------------
//  
//  group = 0,   .
//         [0..10] 
//       [0..10] 
//   1     0   
//---
function ksParametrizeObjects( group : Reference;                //  
                               param : PIParametrizationParam )  //  
                               : Integer; stdcall;


//   - 1003
//-----------------------------------------------------------------------------
// \     
// debugMode = 1 -  0 - 
//    
// ---
function ksSetDebugMessagesMode( debugMode : Integer ) : Integer; stdcall;

////////////////////////////////////////////////////////////////////////////////
//
//  " ". LT_GRDLG  LT_GrDlg.h
//
////////////////////////////////////////////////////////////////////////////////

//   - 5
//-----------------------------------------------------------------------------
//  ,    .
//-----------------------------------------------------------------------------
procedure MessageBoxResult; stdcall;


//   - 180   kAPI2D5.dll
//-----------------------------------------------------------------------------
//         ( ).
//     .
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function ksChoiceFile( ext     : PChar;                    //   
                       filter  : PChar;                    //   (0 -  )
                       name    : PChar;                    //    
                       bufSize : Cardinal;                 //    name
                       preview : Byte  ):Cardinal; stdcall; // 1-    , 0-


//   - 831  kAPI2D5.dll
//-----------------------------------------------------------------------------
//         ( ).
//     .
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function ksChoiceFileW( ext     : PWideChar;                 //   
                        filter  : PWideChar;                 //   (0 -  )
                        name    : PWideChar;                 //    
                        bufSize : Cardinal;                  //    name
                        preview : Byte  ):Cardinal; stdcall; // 1-    , 0-


//   - 213   kAPI2D5.dll 14.7.98
//-----------------------------------------------------------------------------
//         ( ).
//     .
//  typeDir    (   ltdefine.h)
// typeDir = sptSYSTEM_FILES 	0  -    
//           sptLIBS_FILES 		1  -    
//                               
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function ksChoiceFileAppointedDir( ext     : PChar;             //   
                                   filter  : PChar;             //   (0 -  )
                                   name    : PChar;             //    
                                   bufSize : Cardinal;          //    name
                                   preview : Byte;              // 1-    , 0-
                                   typeDir : Integer ): Cardinal; stdcall;


//   - 837   kAPI2D5.dll 14.7.98
//-----------------------------------------------------------------------------
//         ( ).
//     .
//  typeDir    (   ltdefine.h)
// typeDir = sptSYSTEM_FILES 	0  -    
//           sptLIBS_FILES 		1  -    
//                               
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function ksChoiceFileAppointedDirW( ext     : PWideChar;         //   
                                    filter  : PWideChar;         //   (0 -  )
                                    name    : PWideChar;         //    
                                    bufSize : Cardinal;          //    name
                                    preview : Byte;              // 1-    , 0-
                                    typeDir : Integer ): Cardinal; stdcall;


//   - 181   kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//-----------------------------------------------------------------------------
function ksChoiceFiles( ext     : PChar;                   //   
                        filtr   : PChar;                   //   (0 -  )
                        p       : Reference;               //      CHAR_STR_ARR  CHAR_STR_ARR_W
                        preview : Byte ) : Integer; stdcall;// 1-    , 0-


//   - 839   kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//-----------------------------------------------------------------------------
function ksChoiceFilesW( ext     : PWideChar;                 //   
                         filtr   : PWideChar;                 //   (0 -  )
                         p       : Reference;                 //      CHAR_STR_ARR  CHAR_STR_ARR_W
                         preview : Byte ) : Integer; stdcall; // 1-    , 0-


//   - 182   kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//     .
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function  ksSaveFile( ext     :  PChar;                     //   
                      oldName :  PChar;                     //    
                      filter  :  PChar;                     //   (0 -  )
                      name    :  PChar;                     //    
                      bufSize :  Cardinal;                  //    name
                      preview :  Byte ) : Cardinal; stdcall; // 1-    , 0-


//   - 841   kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//     .
//  bufSize    - name  .
//    name    GetRightFileName.
//-----------------------------------------------------------------------------
function  ksSaveFileW( ext     :  PWideChar;                  //   
                       oldName :  PWideChar;                  //    
                       filter  :  PWideChar;                  //   (0 -  )
                       name    :  PWideChar;                  //    
                       bufSize :  Cardinal;                   //    name
                       preview :  Byte ) : Cardinal; stdcall; // 1-    , 0-


//   - 245   kAPI2D5.dll
//------------------------------------------------------------------------------
//       
// ---
function ksInitFilePreviewFunc( func : TFilePreviewFuncCallBack ) : integer ; stdcall;


//   - 842  kAPI2D5.dll
//------------------------------------------------------------------------------
//       
// ---
function ksInitFilePreviewFuncW( func : TFilePreviewFuncCallBackW ) : integer ; stdcall;


//   - 9   kAPI2D5.dll
//-----------------------------------------------------------------------------
//  .
//-----------------------------------------------------------------------------
procedure ksMessage( s : PChar ); stdcall;// s -  


//   - 800   kAPI2D5.dll
//-----------------------------------------------------------------------------
//  .
//-----------------------------------------------------------------------------
procedure ksMessageW( s : PWideChar ); stdcall;// s -  


//   - 10  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
procedure  Error( Msg : PChar ); stdcall; //    


//   - 804  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
procedure  ErrorW( Msg : PWideChar ); stdcall; //    


//   - 11  kAPI2D5.dll
//-----------------------------------------------------------------------------
//        - .
//  1 - Yes; 0 - No; -1 - CANCEL;
//-----------------------------------------------------------------------------
function  YesNo( s : PChar ) : Integer; stdcall; // s -  


//   - 11  kAPI2D5.dll
//-----------------------------------------------------------------------------
//        - .
//  1 - Yes; 0 - No; -1 - CANCEL;
//-----------------------------------------------------------------------------
function  YesNoW( s : PWideChar ) : Integer; stdcall; // s -  


//   - 12  kAPI2D5.dll
//-----------------------------------------------------------------------------
//  BMP   bmpID   (HWindow).
//  1   , 0   .
//-----------------------------------------------------------------------------
function  DrawBitmap( HWindow : HWND;                   // HWND 
	              bmpID   : Cardinal ) : Integer; stdcall; //  BMP    


//   - 748
//-----------------------------------------------------------------------------
// [21.7.04]
//  BMP  
//-----------------------------------------------------------------------------
function  DrawBitmapEx( HWindow   : HWND;                         // HWND 
                        bmpID     : Cardinal;                     //      
                        hInstance : Integer ) : Integer; stdcall; // NULL -    , hInstance -  

//   - 2   kAPI2D5.dll
//-----------------------------------------------------------------------------
//     sldID   (HWindow).
//          RCDATA.
//  1   , 0   .
//-----------------------------------------------------------------------------
function DrawSlide( HWindow : HWND;                          // HWND 
                    sldID   : Cardinal ) : Integer; stdcall; //      

//   - 59  kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ,   RCDATA,  
// (HWindow).
//  1   , 0   .
//-----------------------------------------------------------------------------
function  ksDrawSlideFromFile( HWindow : HWND;                          // HWND 
                               fileName   : PChar ) : Integer; stdcall; //  BMP    


//   - 59  kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ,   RCDATA,  
// (HWindow).
//  1   , 0   .
//-----------------------------------------------------------------------------
function  ksDrawSlideFromFileW( HWindow  : HWND;                           // HWND 
                                fileName : PWideChar ) : Integer; stdcall; //  BMP    


//   - 153   apptool2.dll
//-------------------------------------------------------------------------
//     
//-------------------------------------------------------------------------
function ksDrawSlideEx( HWindow   : HWND;                //  
                        SlideID   : Cardinal;            //      
                        hInstance : Integer ): Integer;  // NULL -    , hInstance -  
                        stdcall;

//   - 3   kAPI2D5.dll
//-----------------------------------------------------------------------------
//           
// fileName.        .
//  1   , 0   .
//-----------------------------------------------------------------------------
function WriteSlide( filename : PChar;          //    
                     iD       : Cardinal;       //  
                     x        : Double;         //     
                     y        : Double ) : Integer;  stdcall;


//   - 844   kAPI2D5.dll
//-----------------------------------------------------------------------------
//           
// fileName.        .
//  1   , 0   .
//-----------------------------------------------------------------------------
function WriteSlideW( filename : PWideChar;      //    
                      iD       : Cardinal;       //  
                      x        : Double;         //     
                      y        : Double ) : Integer;  stdcall;


//   - 43  kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//-----------------------------------------------------------------------------
procedure   ksSlideBackground( color : COLORREF ); stdcall;


//   - 13  kAPI2D5.dll
//-----------------------------------------------------------------------------
//         
//  .
//-----------------------------------------------------------------------------
function   ReadDouble( mess      : PChar;          //  
                       defValue  : Double;         //   
                       min       : Double;                     // ,     
                       max       : Double;
                       Var value : Double ) : Integer; stdcall; //  


//   - 845  kAPI2D5.dll
//-----------------------------------------------------------------------------
//         
//  .
//-----------------------------------------------------------------------------
function   ReadDoubleW( mess      : PWideChar;      //  
                        defValue  : Double;         //   
                        min       : Double;         // ,     
                        max       : Double;
		                    Var value : Double ) : Integer; stdcall; //  


//   - 14  kAPI2D5.dll
//-----------------------------------------------------------------------------
//           .
//-----------------------------------------------------------------------------
function   ReadInt( mess      : PChar;                       //  
                    defValue  : Integer;                     //   
                    min       : Integer;                     // ,     
                    max       : Integer;
                    Var value : Integer ) : Integer; stdcall; //  


//   - 846  kAPI2D5.dll
//-----------------------------------------------------------------------------
//           .
//-----------------------------------------------------------------------------
function  ReadIntW( mess      : PWideChar;                   //  
                    defValue  : Integer;                     //   
                    min       : Integer;                     // ,     
                    max       : Integer;
                    Var value : Integer ) : Integer; stdcall; //  


//   - 15  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
function   ReadString( smess  :  PChar;                       //  
                       str    :  PChar;                       //  
                       maxlen :  Integer ) : Integer; stdcall; //   


//   - 847  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
function  ReadStringW( smess  :  PWideChar;                    //  
                       str    :  PWideChar;                    //  
                       maxlen :  Integer ) : Integer; stdcall; //   


//   - 16  kAPI2D5.dll
//-----------------------------------------------------------------------------
//          
//  .
//-----------------------------------------------------------------------------
function ReadLong( mess      : PChar;                         //  
                   defValue  : LongInt;                       //   
                   min       : LongInt;                       // ,     
                   max       : LongInt;
                   Var value : LongInt ) : Integer; stdcall;   //  


//   - 848  kAPI2D5.dll
//-----------------------------------------------------------------------------
//          
//  .
//-----------------------------------------------------------------------------
function ReadLongW( mess      : PWideChar;                     //  
                    defValue  : LongInt;                       //   
                    min       : LongInt;                       // ,     
                    max       : LongInt;
                    Var value : LongInt ) : Integer; stdcall;   //  


//   - 231    kAPI2D5.dll
//--------------------------------------------------------------------------
//    .     
//  graphic.dsn.
//     /3  0   
//--------------------------------------------------------------------------
function ksViewGetDensity( HWindow : HWND ) : Double; // HWND    NULL
                           stdcall;

//------------------------------------------------------------------------------
//      .
// docPar -  .
// ---
function  ksSheetSetupDlg( docPar : PDocumentParam; HWindow : Pointer ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//      .
// docPar -  .
// ---
function  ksSheetSetupDlgW( docPar : PDocumentParamW; HWindow : Pointer ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//            
//-1    
//0        
//1   
//   NULL,   -1      1 -  
// ---
//      material -         
//      sizeStr  -   material
//      plt      -   
//      kod_size -  
//        kod_size[0] -   .  : 1-, 2-, 0-  .
//        kod_size[1] -    , ,   ,       
//        kod_size[2] -       
//        kod_size[3] -     
//      kod_tip -       ( ),
//       '0' -  .
//        
//      ----------------+-----------------+------------+---------------+-------------------+-------------------------
//         |   |  |    |    |  
//      ----------------+-----------------+------------+---------------+-------------------+-------------------------
//       1-     | 8 -       | 17-  | 24-      | 27-          | 30- 
//       2-     | 9 -        | 18-   | 25-     | 28-         | 31- 
//       3-        | 10 -   | 19-   | 26-     | 29-         | 32- 
//       4-    | 11 -       | 20-   |               |                   | 33- 
//       5- .   | 12 -       | 21-   |               |                   |
//       6-        | 13 -       | 22-  |               |                   |
//       7-        | 14 -      | 23-  |               |                   |
//                      | 15 -     |            |               |                   |
//                      | 16 -       |            |               |                   |
//      ----------------+-----------------+------------+---------------+-------------------+-------------------------
function  ksMaterialDlg( HWindow : Pointer; material : PChar; sizeStr : Integer; Var plt : Double; Var kod_sizeLib : Double4; kod_tip : PChar ) : Integer;  stdcall;

//------------------------------------------------------------------------------
//      *.pdt
//   1    
// ---
function  ksExecDialPredefinedText( HWindow : Pointer; str : PChar; sizeStr : Integer ) : Integer;  stdcall;


//------------------------------------------------------------------------------
//      *.pdt
//   1    
// ---
function  ksExecDialPredefinedTextW( HWindow : Pointer; str : PWideChar; sizeStr : Integer ) : Integer;  stdcall;


//   - 286  kAPI2D5.dll
//------------------------------------------------------------------------------
//     
// ---
function ksEditTextLine( HWindow : HWND; str : PChar;
                         sizeStr : Integer ) : Integer;
                         stdcall;


//   - 853  kAPI2D5.dll
//------------------------------------------------------------------------------
//     
// ---
function ksEditTextLineW( HWindow : HWND; str : PWideChar;
                          sizeStr : Integer ) : Integer;
                         stdcall;


//   - 781
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  minVal -   
//  maxVal -   
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksStartProgressBar( minVal, maxVal : LongInt; newText : PChar; resetText : Integer ); stdcall;


//   - 854
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  minVal -   
//  maxVal -   
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksStartProgressBarW( minVal, maxVal : LongInt; newText : PWideChar; resetText : Integer ); stdcall;


//   - 782
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  currentVal -    
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksSetProgressBar( currentVal : LongInt; newText : PChar; resetText : Integer ); stdcall;


//   - 855
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  currentVal -    
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksSetProgressBarW( currentVal : LongInt; newText : PWideChar; resetText : Integer ); stdcall;


//   - 783
// [01/11/2006]
//------------------------------------------------------------------------------
//       
//  newText-    
// ---
procedure ksSetProgressText( newText : PChar ); stdcall;


//   - 856
// [01/11/2006]
//------------------------------------------------------------------------------
//       
//  newText-    
// ---
procedure ksSetProgressTextW( newText : PWideChar ); stdcall;


//   - 784
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksStopProgressBar( newText : PChar; resetTxt : Integer ); stdcall;


//   - 784
// [01/11/2006]
//------------------------------------------------------------------------------
//    
//  newText-    
//  resetText - TRUE -     
// ---
procedure ksStopProgressBarW( newText : PWideChar; resetTxt : Integer ); stdcall;


///////////////////////////////////////////////////////////////////////////////
//  "   ".  LT_Edit.h
///////////////////////////////////////////////////////////////////////////////


//   - 23  kAPI2D5.dll
//-----------------------------------------------------------------------------
//      ref  :
//   ,     , 
//    .
//      ,  
//  userPars      (   ,
//  ).
//  size -   userPars.
//    fileName=0, libName=0, number=-1  
//      ,   SetMacroParam.
//  1   , 0   .
//-----------------------------------------------------------------------------
function SetMacroParam( ref      : reference;          //   
                        userPars : Pointer;            //     
                        size     : Cardinal;           //    
                        fileName : PChar;              //   ,     
                        libName  : PChar;              //  ,     
                        number   : Integer ) : Integer; //   
                        stdcall;

//   - 23  kAPI2D5.dll
//--------------------------------------------------------------------------
//      
//    ,  ,    ,
//      
//  value -     size,      
//      
//   1-    0-  
//  paramType -  ,      
//  #define MP_DBL_CLICK_OFF  0x01 //>0     
//  #define MP_HOTPOINTS      0x02 //>0  hot  
//  #define MP_EXTERN_EDIT    0x04 //>0   
//--------------------------------------------------------------------------
function ksSetMacroParam( ref       : Reference;        //   
                          userPars  : Pointer;          //     
                          size      : Cardinal;         //    
                          fileName  : PChar;            //   ,     
                          libName   : PChar;            //  ,     
                          number    : Integer;          //  ,   
                          paramType : Byte ) : Integer; //   
                          stdcall;


//   - 859  kAPI2D5.dll
//--------------------------------------------------------------------------
//      
//    ,  ,    ,
//      
//  value -     size,      
//      
//   1-    0-  
//  paramType -  ,      
//  #define MP_DBL_CLICK_OFF  0x01 //>0     
//  #define MP_HOTPOINTS      0x02 //>0  hot  
//  #define MP_EXTERN_EDIT    0x04 //>0   
//--------------------------------------------------------------------------
function ksSetMacroParamW( ref       : Reference;        //   
                           userPars  : Pointer;          //     
                           size      : Cardinal;         //    
                           fileName  : PWideChar;        //   ,     
                           libName   : PWideChar;        //  ,     
                           number    : Integer;          //  ,   
                           paramType : Byte ) : Integer; //   
                           stdcall;


//   - 22  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    ( SetMacroParam)  
//    c  ref.
//  ref=0   ,   
//    (  ).
//      userPars  size, 
//     SetMacroParam.
//  1   , 0   .
//-----------------------------------------------------------------------------
function  GetMacroParam( ref      : Reference;      //   
                         userPars : Pointer; //     
                         size     : Cardinal) : Integer;   //    
                         stdcall;

//   - 262  kAPI2D5.dll
//------------------------------------------------------------------------------
//    c  ref  :
//   ,     , 
//    .
//  ref=0    ,  
//     (  ).
//   NULL  fileName, libName, number   
// fileNameSize, libNameSize    -   .
//  1   , 0   .
// ---
function  ksGetMacroEditParam( ref          : Reference;        //   
                               fileName     : PChar;            //      
                               fileNameSize : Cardinal;         //  a   
                               libName      : PChar;            //     
                               libNameSize  : Cardinal;         //  a  
                               number       : PINT ) : Integer; //    a  
                               stdcall;


//   - 860  kAPI2D5.dll
//------------------------------------------------------------------------------
//    c  ref  :
//   ,     , 
//    .
//  ref=0    ,  
//     (  ).
//   NULL  fileName, libName, number   
// fileNameSize, libNameSize    -   .
//  1   , 0   .
// ---
function ksGetMacroEditParamW( ref          : Reference;        //   
                               fileName     : PWideChar;        //      
                               fileNameSize : Cardinal;         //  ( ) a   
                               libName      : PWideChar;        //     
                               libNameSize  : Cardinal;         //  ( ) a  
                               number       : PINT ) : Integer; //    a  
                               stdcall;


//   - 250  kAPI2D5.dll
//------------------------------------------------------------------------------
//     
//  ref=0   ,   
//    (  ).
// ---
function  GetMacroParamSize( ref : Reference ) : Integer; stdcall;

//   - 24  kAPI2D5.dll
//-----------------------------------------------------------------------------
//       - ?
// : 1 - , 0 - .
//-----------------------------------------------------------------------------
function EditMacroMode : Integer; stdcall;

//   - 197 kAPI2D5.dll
//---------------------------------------------------------------------------
//  , ,      .
// (        )
//           .
//      
//   1   , 0 -   .
//---------------------------------------------------------------------------
function ksAddObjectToMacro( macro : Reference;               //  
                             obj   : Reference ) : Integer;   //   
                             stdcall;

//   - 275
//------------------------------------------------------------------------------
//     macro (    ),
//     gr,     
//   1   , 0 -   .
// ---
function ksUpdateMacro( macro : Reference; gr : Reference ) : Integer; stdcall;

//   - 25  kAPI2D5.dll
//-----------------------------------------------------------------------------
//       ref ( , , , ).
//  1   , 0   .
//-----------------------------------------------------------------------------
function DeleteObj( ref : Reference) : Integer; stdcall;

//   - 26  kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ref ( , , , ).
//   dx,dy -    .
//  1   , 0   .
//-----------------------------------------------------------------------------
function MoveObj( ref   : Reference;          //   
                  dx,dy : Double ) : Integer; //  
                  stdcall;

//   - 27  kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ref ( , , , )
//     x,y (   ).
//  1   , 0   .
//-----------------------------------------------------------------------------
function RotateObj( ref   : reference;           //   
                    x, y  : Double;              //  
                    angle : Double ) : Integer;  //    
                    stdcall;

//   - 28  kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ref ( , , , )
//     (.  Mtr  DeleteMtr ).
//  1   , 0   .
//-----------------------------------------------------------------------------
function  TransformObj( ref : Reference ) : Integer; stdcall;

//   - 29  kAPI2D5.dll
//-----------------------------------------------------------------------------
//  (light=1)   (light=0)   
//   ref ( , , , ).
//  1   , 0   .
//-----------------------------------------------------------------------------
function LightObj( ref   : Reference ;         //   
                   light : Byte ) : Integer;   //  
                   stdcall;

//   - 156 kAPI2D5.dll
//-----------------------------------------------------------------------------
//   (copy=0)    ref ( , ,
// , )        (copy=1).
//       .
//  1   , 0   .
//-----------------------------------------------------------------------------
function SymmetryObj( ref    : Reference;       //   
                      x1, y1 : Double;          //   
                      x2, y2 : Double;          //   
                      copy   : Byte ): Integer; //  
                      stdcall;

//   - 217 kAPI2D5.dll
//--------------------------------------------------------------------------
//   (copy=0)    ref ( , ,
// , )        (copy=1).
//       .
//          ,
// 0   .
//--------------------------------------------------------------------------
function  ksSymmetryObj( ref    : Reference;       //   
                         x1, y1 : Double;      //   
                         x2, y2 : Double;             //   
                         copy   : Byte ) : Reference; //  
                         stdcall;

//   - 157 kAPI2D5.dll
//-----------------------------------------------------------------------------
//     ref ( , , , )  
//          
//  .
//       .
//  1   , 0   .
//-----------------------------------------------------------------------------
function  CopyObj( ref        : Reference;           //   
                   xOld, yOld : Double;              //   
                   xNew, yNew : Double;              //    
                   scale      : Double;              //      
                   angle      : Double  ) : Integer;
                   stdcall;

//   - 216 kAPI2D5.dll
//--------------------------------------------------------------------------
//     ref ( , , , )  
//          
//  .
//          , 0
//   .
//       .
//--------------------------------------------------------------------------
function  ksCopyObj( ref        : Reference;           //   
                     xOld, yOld : Double;              //   
                     xNew, yNew : Double;              //    
                     scale      : Double;              //      
                     angle      : Double ) : Reference;
                     stdcall;

//   - 54  kAPI2D5.dll
//-----------------------------------------------------------------------------
//    ,     .
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksEditViewObject.
//       0.
// type      [LINESEG_OBJ ...MULTITEXTLEADER] (ltdefine.h)
//-----------------------------------------------------------------------------
function  ksCreateViewObject( _type : Word ) : Reference; stdcall;

//   - 55  kAPI2D5.dll
//-----------------------------------------------------------------------------
//        ref.
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksCreateViewObject.
//  1 -  , 0 - .
//-----------------------------------------------------------------------------
function  ksEditViewObject( ref : Reference ) : Integer; stdcall;

//   - 4   kAPI2D5.dll
//-----------------------------------------------------------------------------
//      ref.
// parType   [ALLPARAM ... DIM_VALUE] . ltdefine.h
//  1   , 0   .
//-----------------------------------------------------------------------------
function SetObjParam( ref     : Reference;            //   
                      param   : Pointer;              //    
		      parSize : Integer;              //   
		      parType : Integer ) : Integer;  //     
                      stdcall;

//   - 5   kAPI2D5.dll
//-----------------------------------------------------------------------------
//      ref.
// parType   [ALLPARAM ... DIM_VALUE] . ltdefine.h
//    [LINESEG_OBJ ...ANNTEXT_OBJ] (ltdefine.h)   ,
// 0   .
//-----------------------------------------------------------------------------
function GetObjParam( ref     : Reference;             //    
                      param   : Pointer;               //    
		      parSize : Integer;               //   
		      parType : Integer ) : Integer;   //     
                      stdcall;

//   - 25
//-----------------------------------------------------------------------------
//       styleId.
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   1   ; 0 -   ,   
//  param      .
//-----------------------------------------------------------------------------
function  GetStyleParam( _type   : Byte;                 //  
                         styleId : Word;                 //  
                         param   : Pointer;              //     
                         size    : Cardinal ) : Integer; //   
                         stdcall;

//   - 26  kAPI2D5.dll
//-----------------------------------------------------------------------------
//       (type=CURVE_STYLE)   (type=TEXT_STYLE).
//   copy = 0 -   :
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//       , 0   .
//-----------------------------------------------------------------------------
function AddStyle( _type : Byte;            //  
                   param : Pointer;         //     
                   size  : Cardinal;        //   
                   copy  : Byte ) : Word;   //     
                   stdcall;

//   - 106  kAPI2D5.dll
//-------------------------------------------------------------------------------------
// ,      
//   copy = 0 -   :
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//   1,     , 0 -  
//-------------------------------------------------------------------------------------
function ksIsStyleInDocument( _type : Byte;                     //  
                              val   : Pointer;                  //     
                              size  : Cardinal;                 //   
                              copy  : Byte ) : Integer; stdcall; // 0 -   1-   

//   - 107  kAPI2D5.dll
//-------------------------------------------------------------------------------------
//     
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//   1,     , 0 -  
//-------------------------------------------------------------------------------------
function ksDeleteStyleFromDocument( _type : Byte;             //  
                                    val   : Pointer;          //     
                                    size  : Cardinal;         //   
                                    flag  : Byte ) : Integer; // 0 -   1-   
                                    stdcall;

//   - 70    kAPI2D5.dll
//-------------------------------------------------------------------------------------
//       LIBRARY_STYLE_ARR -
//    ,     .
//     0.
// libraryType   [CURVE_STYLE_LIBRARY...SPC_LAYOUT_STYLE_LIBRARY]
//-------------------------------------------------------------------------------------
function ksGetLibraryStylesArray( libraryName : PChar;               //    
                                  libraryType : Byte ) : Reference;  //   
                                  stdcall;


//   - 70    kAPI2D5.dll
//-------------------------------------------------------------------------------------
//       LIBRARY_STYLE_ARR -
//    ,     .
//     0.
// libraryType   [CURVE_STYLE_LIBRARY...SPC_LAYOUT_STYLE_LIBRARY]
//-------------------------------------------------------------------------------------
function ksGetLibraryStylesArrayW( libraryName : PWideChar;           //    
                                   libraryType : Byte ) : Reference;  //   
                                   stdcall;


//   - 30  kAPI2D5.dll
//-----------------------------------------------------------------------------
// ,      ref.
//   1 -  , 0 - .
//-----------------------------------------------------------------------------
function ExistObj( ref : Reference) : Integer; stdcall;

//   - 31  kAPI2D5.dll
//-----------------------------------------------------------------------------
//  ,    .
// limit -     .
//         ,
// 0   .
//-----------------------------------------------------------------------------
function FindObj( x,y   : Double;                //  
                  limit : Double ) : Reference;  //  
                  stdcall;

//   - 154 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//      .
//  1-   , 0   .
//--------------------------------------------------------------------------
function GetObjGabaritRect( p   : Reference;              //  
                            par : PRectParam ) : Integer; //  
                            stdcall;

//   - 161 kAPI2D5.dll
//--------------------------------------------------------------------------
//    CK    CK 
//--------------------------------------------------------------------------
function ViewToSheet( x, y     : Double;             // 
                      Var outX : Double;             // 
                      Var outY : Double ) : Integer;
                      stdcall;

//   - 162 kAPI2D5.dll
//--------------------------------------------------------------------------
//    CK   CK  
//--------------------------------------------------------------------------
function  SheetToView( x, y     : Double;   // 
                       Var outX : Double;   // 
                       Var outY : Double ) : Integer;
                       stdcall;

//   - 32 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//     .
//      ,      .
//          .
//          StoreTmpGroup,
//          .
//--------------------------------------------------------------------------
function NewGroup( _tmp : Byte ) : Reference;  //  0 -  1 -  
                   stdcall;

//   - 33 kAPI2D5.dll
//--------------------------------------------------------------------------
//   .
//   , , ,    
//   NewGroup  EndGroup   .
//    ,   .
//--------------------------------------------------------------------------
procedure EndGroup; stdcall;

//   - 34 kAPI2D5.dll
//--------------------------------------------------------------------------
//    g.
//    -  .  g = 0,   .
//--------------------------------------------------------------------------
function ClearGroup( g : Reference ) :Integer;  //  
                     stdcall;

//   - 263 kAPI2D5.dll
//--------------------------------------------------------------------------
//    g.  g = 0,   .
// deleteTmp = 1 ->   .
//--------------------------------------------------------------------------
function ksClearGroup( g : Reference; deleteTmp : Byte ) : Integer;
                     stdcall;


//   - 35 kAPI2D5.dll
//--------------------------------------------------------------------------
//    p   g.
//     - .  g = 0,  
//--------------------------------------------------------------------------
function ExcludeObjGroup( g : Reference;              // 
                          p : Reference ) : Integer;  //   
                          stdcall;

//   - 36 kAPI2D5.dll
//--------------------------------------------------------------------------
//   p   g.   g = 0,  
//--------------------------------------------------------------------------
function AddObjGroup( g : Reference;                // 
		      p : Reference ) : Integer;    //   
                      stdcall;

//   - 37 kAPI2D5.dll
//--------------------------------------------------------------------------
//     g    ( ).
//--------------------------------------------------------------------------
function StoreTmpGroup( g : Reference ) : integer;  // 
                        stdcall;

//   - 38
//--------------------------------------------------------------------------
//   g    .  g = 0,  .
//--------------------------------------------------------------------------
function SaveGroup( g    : Reference;  //  
                    name : PChar ) : integer; //  
                    stdcall;

//   - 862
//--------------------------------------------------------------------------
//   g    .  g = 0,  .
//--------------------------------------------------------------------------
function SaveGroupW( g    : Reference;  //  
                     name : PWideChar ) : integer; //  
                     stdcall;


//   - 39 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .    .
//--------------------------------------------------------------------------
function GetGroup( name : PChar ) : Reference; // 
                   stdcall;


//   - 39 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .    .
//--------------------------------------------------------------------------
function GetGroupW( name : PWideChar ) : Reference; // 
                    stdcall;


//   - 40 kAPI2D5.dll
//--------------------------------------------------------------------------
//     g.
// selectMode=1 -  ;
// selectMode=2 - ;
// selectMode=3 -  ;
//  -     .
//--------------------------------------------------------------------------
function SelectGroup( g          : Reference;            // 
                      selectMode : Byte;                 // 
                      xmin, ymin : Double;               //  -
                      xmax, ymax : Double ) : Integer;   //  -
                      stdcall;

//   - 41 kAPI2D5.dll
//---------------------------------------------------------------------------
//         g .
// 1-   0- .  g = 0,  
//---------------------------------------------------------------------------
function ExistGroupObj( g : Reference ) : Integer;
                        stdcall;

//   - 239 kAPI2D5.dll
//------------------------------------------------------------------------------
//    clip        
//  1      0   
// ---
function  ksWriteGroupToClip( g    : Reference;         //   
                              copy : Byte ) : Integer; // 1 -  ; 0 -     
                              stdcall;

//   - 240 kAPI2D5.dll
//------------------------------------------------------------------------------
//    clip      .
//     .     clip ,
//  .
//          0   
// ---
function  ksReadGroupFromClip : Reference;  stdcall;

//   - 249 kAPI2D5.dll
//////////////////////////////////////////////////////////////////////////
//       
//   0 -   
//                    1 -   (   )
//                    2 -   (   )
//                   -1 -   (  size     ,    )
//---
function ksGetGroupName( gr    : Reference;                        //   
                         name : PChar; size : Integer ) : Integer; //        
                         stdcall;


//   - 864 kAPI2D5.dll
//////////////////////////////////////////////////////////////////////////
//       
//   0 -   
//                    1 -   (   )
//                    2 -   (   )
//                   -1 -   (  size     ,    )
//---
function ksGetGroupNameW( gr    : Reference;                             //   
                          name  : PWideChar; size : Integer ) : Integer; //        
                          stdcall;


//   - 285 apptold.dll
//------------------------------------------------------------------------------
//       ( ,  ,
// , ,  )    (   
//   3-)
//     
//  1     0   
// ---
function ksDestroyObjects( p : reference ) : Integer;  //  , ,   
                           stdcall;

//   - 59 kAPI2D5.dll
//---------------------------------------------------------------------------
//    .
//     .   
//    ,    .
//   ,    Mtr  DeleteMtr1, 
//     .
//---------------------------------------------------------------------------
function Mtr( x, y,                          //   
              angle,                         //     .
              scale : Double ) : Integer;    //   
              stdcall;

//   - 248 kAPI2D5.dll
//---------------------------------------------------------------------------
//    .
//     .   
//    ,    .
//   ,    ksMtr  DeleteMtr, 
//     .
//---------------------------------------------------------------------------
function ksMtr( x, y,                        //    
	              angle,                       //      .
		            scaleX,                      //       
                scaleY : Double ) : Integer; //       Y
                stdcall;

//   - 160 kAPI2D5.dll
//---------------------------------------------------------------------------
//         rotateMtr 
//     moveArr
//   ,    MtrForIGES  DeleteMtr, 
//     .
//---------------------------------------------------------------------------
function MtrForIGES( rotateMtr : Double2_2;
                     moveArr   : Double2 ) : Integer; stdcall;


//   - 60 kAPI2D5.dll
//---------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------
function DeleteMtr : Integer; stdcall;

//   - 100 kAPI2D5.dll
//----------------------------------------------------------------------
// C     .
//    , , ,  - parent  (0).
//----------------------------------------------------------------------
function CreateIterator( tipSeartch : Integer;                 //  
                         parent     : Reference ) : Reference; //  (   ,  ,  )
                         stdcall;

//   - 101 kAPI2D5.dll
//----------------------------------------------------------------------
//    .
//----------------------------------------------------------------------
function MoveIterator( iterator : Reference;       //  
                       ch : Char ) : reference;    //  'F'/'N'  - /
                       stdcall;

//   - 102 kAPI2D5.dll
//----------------------------------------------------------------------
//      .
//  obj = 0,         .
//  obj != 0,      , , , , 
//      .
//  obj != 0,     , 
//      .
//----------------------------------------------------------------------
function CreateAttrIterator( obj                    : Reference;            //     0
                             key1, key2, key3, key4 : Cardinal;             //       0
                             numb                   : Double ) : reference; //         0
                             stdcall;

//   - 103 kAPI2D5.dll
//----------------------------------------------------------------------
//    .     .
//           ,
//  pObj -      .
//  pObj = NULL, pObj  .
//----------------------------------------------------------------------
function MoveAttrIterator ( iterator : Reference;              //   
                            ch       : Char;                   //   'F'/'N'
                            var pObj : reference): reference;  //   
                            stdcall;

//   - 104 kAPI2D5.dll
//----------------------------------------------------------------------
//      .
//----------------------------------------------------------------------
function DeleteIterator( iterator : Reference ) : Integer; //  
                         stdcall;

//   - 86 kAPI2D5.dll
//--------------------------------------------------------------------------
//     .
// tip = [CHAR_STR_ARR ...POLYLINE_ARR_W] . ltdefine.h
//--------------------------------------------------------------------------
function  CreateArray( tip  : Integer;                  // 
                       func : PDeleteFunc ): Reference;   //    USER_ARR
                       stdcall;

//   - 87 kAPI2D5.dll
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
function DeleteArray( p : Reference ) : Integer; //   
                      stdcall;

//   - 88 kAPI2D5.dll
//--------------------------------------------------------------------------
//  .
//--------------------------------------------------------------------------
function  ClearArray( p : Reference ) : Integer;  //   
                      stdcall;

//   - 89 kAPI2D5.dll
//--------------------------------------------------------------------------
//         
//  .
//--------------------------------------------------------------------------
function GetArrayCount( p : Reference ) : Integer;  //   
                        stdcall;

//   - 90 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//--------------------------------------------------------------------------
function  AddArrayItem( p     : Reference;              //   
                        numb  : Integer;                //        
                                                        //   numb =-1    
                        value : Pointer;                //    
                        size  : Integer ) : Integer;    //   
                        stdcall;

//   - 91 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//--------------------------------------------------------------------------
function  ExcludeArrayItem( p    : Reference;              //   
                            numb : Integer ) : Integer;     //    (    0 )
                            stdcall;

//   - 92 kAPI2D5.dll
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
function GetArrayItem( p     : Longint;            //   
                       numb  : Integer;            //    (    0 )
                       value : Pointer;            //    
                       size  : Integer ) : Integer;  //   
                       stdcall;

//   - 93 kAPI2D5.dll
//--------------------------------------------------------------------------
//        .
//--------------------------------------------------------------------------
function  GetUserArrayItem( p         : Reference;           //   
                            numb      : Integer;             //   
  			    Var value : Pointer ) : Integer; //     
                            stdcall;

//   - 94 kAPI2D5.dll
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
function  SetArrayItem( p     : Reference;             //   
                        numb  : Integer;               //    (    0 )
                        value : Pointer;               //    
                        size  : Integer ) : Integer;   //   
                        stdcall;

//   - 95 kAPI2D5.dll
//--------------------------------------------------------------------------
//   .
//--------------------------------------------------------------------------
function GetArrayType ( p : Reference ) : Integer; //   
                        stdcall;

//   - 13 kAPI2D5.dll
//--------------------------------------------------------------------------
//      - , , .
//            .
//     ( p-    ,
// type -   ,   1 )
//      .
//--------------------------------------------------------------------------
function  DecomposeObj( p     : Reference;           //  
                        level : Byte;                //  0- ,,,;
                                                     //                  1-,,; 2-, , 
                        arrow : Double;              // 
                        _type : Byte ) : Reference;  // 0 -      1-   
                        stdcall;

//   - 57 kAPI2D5.dll
//--------------------------------------------------------------------------
//        Decompose
//  arr == 0    count == 0    
//--------------------------------------------------------------------------
function ksLoadNonDecomposSpecSymbols( Var arr : Integer;
                                       count   : Cardinal ) : Integer;
                                       stdcall;

//   - 146 kAPI2D5.dll
//--------------------------------------------------------------------------
//     .
//  p = 0,         .
//--------------------------------------------------------------------------
function GetViewObjCount( p : Reference ) : LongInt; //  
                          stdcall;

//   - 149 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//      ,  
//    InsertFragment, DeleteObj.
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//       .
//       -   
//   .
//--------------------------------------------------------------------------
function  FragmentDefinition( fileName   : PChar;             //  
                              comment    : PChar;             // 
                              insertType : Byte ) : Reference;//  -   
                                                              // 0-   , 1- 
                              stdcall;


//   - 862 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//      ,  
//    InsertFragment, DeleteObj.
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//       .
//       -   
//   . (Unicode)
//--------------------------------------------------------------------------
function  FragmentDefinitionW( fileName   : PWideChar;          //   
                               comment    : PWideChar;          //  
                               insertType : Byte ) : Reference; //   -   
                                                                // 0-   , 1- 
                               stdcall;


//   - 150 kAPI2D5.dll
//--------------------------------------------------------------------------
//   .
//         
//   .
//      " ".
//--------------------------------------------------------------------------
function InsertFragment( p           : Reference;                       //    
                         curentLayer : Byte;                            //    0 -    1-   
                         par         : PPlacementParam ) : Reference;   // 
                         stdcall;


//   - 287 kAPI2D5.dll
//--------------------------------------------------------------------------
//          
//         
//   .
//      " ".
//--------------------------------------------------------------------------
function ksInsertFragmentEx( p           : Reference;             //    
                             curentLayer : Byte;                  //    0 -    1-   
                             par         : PPlacementParam;       // 
                             scaleProjLinesSize : Byte ) : Reference; //       
                             stdcall;


//   - 151 kAPI2D5.dll
//--------------------------------------------------------------------------
//        .
//     1   , 0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//--------------------------------------------------------------------------
function ReadFragment( fileName    : PChar;                       //  
                       curentLayer : Byte;                        //    0 -    1-   
                       par         : PPlacementParam ) : Integer; // 
                       stdcall;


//   - 866 kAPI2D5.dll
//--------------------------------------------------------------------------
//        .
//     1   , 0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//--------------------------------------------------------------------------
function ReadFragmentW( fileName    : PWideChar;                   //  
                        curentLayer : Byte;                        //     0 -    1-   
                        par         : PPlacementParam ) : Integer; //  
                        stdcall;


//   - 226 kAPI2D5.dll
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//--------------------------------------------------------------------------
function  ksReadFragmentToGroup( fileName    : PChar;                        //  
                                 curentLayer : Byte;                         //     0 -    1-   
                                 par         : PPlacementParam ) : Reference;//  
                                 stdcall;

//   292 -  kAPI2D5.dll
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//  scaleProjLinesSize -       
//--------------------------------------------------------------------------
function  ksReadFragmentToGroupEx( fileName  : PChar;                     //  
                                 curentLayer : Byte;                      //     0 -    1-   
                                 par         : PPlacementParam;
                                 scaleProjLinesSize : Byte ) : Reference; //  
                                 stdcall;


//   868 -  kAPI2D5.dll
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//  scaleProjLinesSize -       
//--------------------------------------------------------------------------
function  ksReadFragmentToGroupExW( fileName    : PWideChar;                 //  
                                    curentLayer : Byte;                      //     0 -    1-   
                                    par         : PPlacementParam;
                                    scaleProjLinesSize : Byte ) : Reference; //  
                                    stdcall;


//   - 166 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//    
//   gr = 0 -  
//----------------------------------------------------------------------------------------------
function WriteFragment( gr       : Reference;          //  
                        filename : PChar;              //  
                        comment  : PChar;              //  
                        xb, yb   : Double ) : Integer; // 
                        stdcall;


//   - 869 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//    
//   gr = 0 -  
//----------------------------------------------------------------------------------------------
function WriteFragmentW( gr       : Reference;          //   
                         filename : PWideChar;          //   
                         comment  : PWideChar;          //   
                         xb, yb   : Double ) : Integer; //  
                         stdcall;


//   - 152 kAPI2D5.dll
//--------------------------------------------------------------------------
//      .    
//  .     
//-------------------------------------------------------------------------
function LocalFragmentDefinition( comment : PChar ) : Integer; // 
                                  stdcall;


//   - 870 kAPI2D5.dll
//--------------------------------------------------------------------------
//      .    
//  .     
//-------------------------------------------------------------------------
function LocalFragmentDefinitionW( comment : PWideChar ) : Integer; // 
                                   stdcall;


//   - 153 kAPI2D5.dll
//--------------------------------------------------------------------------
//       , 
//    LocalFragmentDefinition  CloseLocalFragmentDefinition,
//   .
//     ,  
//   InsertFragment, DeleteObj.
//--------------------------------------------------------------------------
function CloseLocalFragmentDefinition : Reference; stdcall;


//   - 196 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//         
//  frwName   -    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//   ,  -      ).
//       .  .
//  Enter -   . Esc - .
//   3 - , 2 - , 1-   , 0 - .
//----------------------------------------------------------------------------------------------
function ksChoiceFragmentFromLib( frwLibFile : PChar;            //    
                                  frwName    : PChar;            //  
                                  size       : Cardinal ) : Integer; //   frwName
                                  stdcall;


//   - 871 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//         
//  frwName   -    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//   ,  -      ).
//       .  .
//  Enter -   . Esc - .
//   3 - , 2 - , 1-   , 0 - .
//----------------------------------------------------------------------------------------------
function ksChoiceFragmentFromLibW( frwLibFile : PWideChar;            //    
                                   frwName    : PWideChar;            //  
                                   size       : Cardinal ) : Integer; //   frwName
                                   stdcall;


//   - 198 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//   
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -   
//----------------------------------------------------------------------------------------------
function ksFragmentLibrary( libName : PChar;                //   
                            _type   : Integer ) : Integer;  //   
                            stdcall;


//   - 872 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//   
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -   
//----------------------------------------------------------------------------------------------
function ksFragmentLibraryW( libName : PWideChar;            //    
                             _type   : Integer ) : Integer;  //    
                             stdcall;


//   - 199 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//       frwName      libName
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -   
//----------------------------------------------------------------------------------------------
function ksAddFragmentToLibrary ( libName : PChar;             //    
                                  frwName : PChar ) : Integer; //   
                                  stdcall;


//   - 873 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//       frwName      libName
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -   
//----------------------------------------------------------------------------------------------
function ksAddFragmentToLibraryW( libName : PWideChar;             //    
                                  frwName : PWideChar ) : Integer; //   
                                  stdcall;


//   - 215 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//          ,
//  1    0   
//----------------------------------------------------------------------------------------------
function ksCheckFragmentLibrary( libName         : PChar;             //    
                                 possibleMessage : Byte ) : Integer;  // 1 - ,     0 -  
                                 stdcall;


//   - 874 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//          ,
//  1    0   
//----------------------------------------------------------------------------------------------
function ksCheckFragmentLibraryW( libName         : PWideChar;         //    
                                  possibleMessage : Byte ) : Integer;  // 1 - ,     0 -  
                                  stdcall;


//   - 242 kAPI2D5.dll
//------------------------------------------------------------------------------
//         frwName   
// frwName   -    "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -      ).
//    0  -    
//                    -1 -  
//                     1      
// ---
function ksExistFragmentInLibrary( frwName : PChar ) : Integer; stdcall;


//   - 875 kAPI2D5.dll
//------------------------------------------------------------------------------
//         frwName   
// frwName   -    "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -      ).
//    0  -    
//                    -1 -  
//                     1      
// ---
function ksExistFragmentInLibraryW( frwName : PWideChar ) : Integer; stdcall;


//   - 297
//---------------------------------------------------------------------------
//         
// 
// libName -     , , 
//---------------------------------------------------------------------------
function ksGetLibraryTreeStruct( libName : PChar; root : PTreeNodeParam ) : Integer; stdcall;


//   - 876
//---------------------------------------------------------------------------
//         
// 
// libName -     , , 
//---------------------------------------------------------------------------
function ksGetLibraryTreeStructW( libName : PWideChar; root : PTreeNodeParamW ) : Integer; stdcall;


//   - 155 kAPI2D5.dll
// -------------------------------------------------------------------------
//   .     .
//     ,  ,   
//  .
// -------------------------------------------------------------------------
function ReleaseReference( p : Reference ) : Integer;   //  
                           stdcall;

// ------------------------------------------------------------------------
//  :  
// ------------------------------------------------------------------------

//   -  kAPI2D5.dll
//----------------------------------------------------------------------
//   -  .
//    (     ).
//    .      0   .
//----------------------------------------------------------------------
function CreateDocument ( par : PDocumentParam ) : Reference;//  
                          stdcall;


//   - 877 kAPI2D5.dll
//----------------------------------------------------------------------
//   -  .
//    (     ).
//    .      0   .
//----------------------------------------------------------------------
function CreateDocumentW( par : PDocumentParamW ) : Reference;//  
                          stdcall;


//   - 706
//----------------------------------------------------------------------
//   
//    (     )
//    
//    
//----------------------------------------------------------------------
function CreateTextDocument( par : PTextDocumentParam ) : Reference; //   
                             stdcall;

//   - 877
//----------------------------------------------------------------------
//   
//    (     )
//    
//     (Unicode)
//----------------------------------------------------------------------
function CreateTextDocumentW( par : PTextDocumentParamW ) : Reference; //   
                              stdcall;


//   - 97 kAPI2D5.dll
//----------------------------------------------------------------------
//    (  ).
//  : 0 -  ,  1 -  
//   3 -       
//   4 -        
//   .     .
//      0   .
//----------------------------------------------------------------------
function OpenDocument( nameDoc : PChar;              //-  
                       regim   : Byte ) : Reference; // 0 -  , 1 -  
                       stdcall;


//   - 878 kAPI2D5.dll
//----------------------------------------------------------------------
//    (  ).
//  : 0 -  ,  1 -  
//   3 -       
//   4 -        
//   .     .
//      0   .
//----------------------------------------------------------------------
function OpenDocumentW( nameDoc : PWideChar;          //-  
                        regim   : Byte ) : Reference; // 0 -  , 1 -  
                        stdcall;


//   - 98 kAPI2D5.dll
//----------------------------------------------------------------------
//   .
//  1     0   .
//    .  fileName - NULL,    
// .        NULL  .
//  sheet = 0   .
//----------------------------------------------------------------------
function SaveDocument ( sheet    : Reference;         //  
                        fileName : PChar ) : Integer; //      Safe as...  NULL
                        stdcall;

//   - 755
//----------------------------------------------------------------------
// [31.03.2005]
//   
//  1     0   
//    
//  fileName - NULL -      
//        NULL  
//  sheet=0   
// saveMode = -1 -   
//             0 -   
//             1 -    5.11
//----------------------------------------------------------------------
function SaveDocumentEx( sheet : Reference; fileName : PChar; saveMode : Integer ) : Integer; stdcall;


//   - 880
//----------------------------------------------------------------------
// [31.03.2005]
//   
//  1     0   
//    
//  fileName - NULL -      
//        NULL  
//  sheet=0   
// saveMode = -1 -   
//             0 -   
//             1 -    5.11
//----------------------------------------------------------------------
function SaveDocumentExW( sheet : Reference; fileName : PWideChar; saveMode : Integer ) : Integer; stdcall;


//   - 700
//----------------------------------------------------------------------
//      
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
function ksSaveAsToRasterFormat ( sheet    : Reference;         //  
                                  fileName : PChar;             //   
                                  par      : PRasterFormatParam ) : Integer; //      
                                  stdcall;


//   - 881
//----------------------------------------------------------------------
//      
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
function ksSaveAsToRasterFormatW( sheet    : Reference;             //  
                                  fileName : PWideChar;             //   
                                  par      : PRasterFormatParamW ) : Integer; //       
                                  stdcall;


//   - 706
//----------------------------------------------------------------------
//        
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
function ksSaveAsToUncompressedRasterFormat
                                ( sheet    : Reference;         //  
                                  fileName : PChar;             //   
                                  par      : PRasterFormatParam ) : Integer; //      
                                  stdcall;


//   - 706
//----------------------------------------------------------------------
//        
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
function ksSaveAsToUncompressedRasterFormatW
                                ( sheet    : Reference;                       //  
                                  fileName : PWideChar;                       //   
                                  par      : PRasterFormatParamW ) : Integer; //      
                                  stdcall;


//   - 99 kAPI2D5.dll
//----------------------------------------------------------------------
//   .  1     0   .
//      ,   .
//  sheet = 0,    .
//----------------------------------------------------------------------
function CloseDocument ( sheet : Reference ) : Integer;  //  
                         stdcall;

//   - 234 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   
//          0   
//-------------------------------------------------------------------------------
function ksGetCurrentDocument( _type : Byte ) : Reference; // 0 -  
                                                stdcall;   // 1 -   
                                                           // 2 -  
                                                           // 3 - 3d 
                                                           // 4 -  

//   - 718
//-----------------------------------------------------------------------------
//  2D 
//      .        ,
//    .
//         ,     .
//  sheet == 0   .
//   1   , 0 -   
// ---
function ksRebuildDocument(  sheet : Reference ) : Integer; stdcall; //   2D  -

//   - 130 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    .    .
//   .  TextLine,   
//  OpenTechnicalDemand   CloseTechnicalDemand,   .
//   ,     ,  
//     .    
//   .
//  CloseTechnicalDemand     .
//-------------------------------------------------------------------------------
function OpenTechnicalDemand( pGab  : Reference;        //      0
                              style : Word ) : Integer; //      0 -  
                              stdcall;

//   - 131
//-------------------------------------------------------------------------------
//    " ".
//-------------------------------------------------------------------------------
function CloseTechnicalDemand : Reference; stdcall;

//   - 136 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     "".   .
//      ColumnNumber   TextLine,   
//  OpenStamp   CloseStamp,  .
//  ColumnNumber    ,   .
//          .
//  CloseStamp    .
//--------------------------------------------------------------------------------
function OpenStamp : Integer; stdcall;

//   - 760
//--------------------------------------------------------------------------------
//     "".   .
//      ColumnNumber   TextLine,   
//  OpenStamp   CloseStamp,  .
//  ColumnNumber    ,   c.
//          .
//  CloseStamp    .
//  sheetNumb -  ,   1
// [20.06.2005]
//---------------------------------------------------------------------------
function OpenStampEx( sheetNumb :Integer ) : Integer; stdcall;

//   - 137 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     "".   .
//--------------------------------------------------------------------------------
function CloseStamp : Reference; stdcall;

//   - 138 kAPI2D5.dll
//---------------------------------------------------------------------------
//   .
//      , ,  ,
//     
//---------------------------------------------------------------------------
function ColumnNumber( numb : Cardinal ): Integer; stdcall;

//   - 139 kAPI2D5.dll
//---------------------------------------------------------------------------
//    - .   .
//  numb = 0,   .    -  .
//---------------------------------------------------------------------------
function ClearStamp( numb : Cardinal ): Integer; stdcall;

//   - 761
//---------------------------------------------------------------------------
//    - .   .
//  numb = 0,   .    -  .
// [20.06.2005]
//---------------------------------------------------------------------------
function ClearStampEx( sheetNumb : Integer; numb : Cardinal ) : Integer; stdcall;

//   - 179 kAPI2D5.dll
//---------------------------------------------------------------------------
//    ,     
//         ColumnNumber,    
// 
//         - TEXT_LINE_ARR
//  0,        
//                      OpenStamp( );
//   numb != NULL -                      GetStampColumnText(...);
//                 CloseStamp( );
//---------------------------------------------------------------------------
function GetStampColumnText( Var numb : Cardinal ) : Reference; stdcall;

//   - 235 kAPI2D5.dll
//---------------------------------------------------------------------------
//                                      OpenStamp( );
//                 SetStampColumnText(...);
//  1     0                CloseStamp( );
//---------------------------------------------------------------------------
function SetStampColumnText( numb    : Cardinal;                // 
                             textArr : Reference ) : Integer;   //    - TEXT_LINE_ARR
                             stdcall;

//   - 731
//---------------------------------------------------------------------------
//     
// material -  ,     (TEXT_LINE_ARR)
// density  - 
//  1     0   
//---------------------------------------------------------------------------
function ksSetMaterialParam( material : Reference; density : Double ) : Integer; stdcall;

//   - 24 kAPI2D5.dll
//-------------------------------------------------------------------------------
//     ,    :
// t=0 - ;
// t=1 - ;
// t=2 - ;
// t=3 - ;
// t=4 -  ;
// t=6 - 
//-------------------------------------------------------------------------------
function GetReferenceDocumentPart( t : Byte ) : Reference; stdcall;

//   - 762
//-------------------------------------------------------------------------------
//    
//    :
// t=0 - ,                 sheetNumb -  ,   1
// t=1 - ,   sheetNumb -  
// t=2 -  sheetNumb -  
// t=3 -                sheetNumb -  
// t=4 -  ;    sheetNumb -  ,   1; 0 -  
// t=5 -               sheetNumb -  
// t=6 -          sheetNumb -  ,   1
// [20.06.2005]
//-------------------------------------------------------------------------------
function GetReferenceDocumentPartEx( t : Byte; sheetNumb : Integer ) : Reference; stdcall;

//   - 76 kAPI2D5.dll
//--------------------------------------------------------------------------
//  .   .    .
//   *number = 0,       .
//  *number = n,     n.   n ,
//    ( reference = 0) - .
//--------------------------------------------------------------------------
function CreateSheetView( par : PViewParam;                    //    
                          var number : Integer ) : Reference;  // 
                          stdcall;


//   - 792 kAPI2D5.dll
//--------------------------------------------------------------------------
//  .   .    .
//   *number = 0,       .
//  *number = n,     n.   n ,
//    ( reference = 0) - .
//--------------------------------------------------------------------------
function CreateSheetViewW( par : PViewParamW;                   //     
                           var number : Integer ) : Reference;  //  
                           stdcall;


//   - 710
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetArbitraryView( par    : PAssociationViewParam;            //   
                                     number : Integer ) : Reference; stdcall;   //  


//   - 793
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetArbitraryViewW( par    : PAssociationViewParamW;          //   
                                      number : Integer ) : Reference; stdcall;  //  


//   - 711
//--------------------------------------------------------------------------
//    
//  1   , 0   
//--------------------------------------------------------------------------
function ksCreateSheetStandartViews( par       : PAssociationViewParam;  //  
                                     bitVector : Cardinal;              //     VIEW_FRONT...VIEW_ISO,   
                                     dx, dy    : Double  )              //        
                                     : Reference; stdcall;


//   - 794
//--------------------------------------------------------------------------
//    
//  1   , 0   
//--------------------------------------------------------------------------
function ksCreateSheetStandartViewsW( par       : PAssociationViewParamW; //  
                                      bitVector : Cardinal;               //     VIEW_FRONT...VIEW_ISO,   
                                      dx, dy    : Double  )               //        
                                                : Reference; stdcall;


//   - 712
//--------------------------------------------------------------------------
//    
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetProjectionView( par    : PAssociationViewParam;  //  
                                      number : PInteger;               //  
                                      view   : Reference )             //   
                                      : Reference; stdcall;


//   - 795
//--------------------------------------------------------------------------
//    
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetProjectionViewW( par    : PAssociationViewParamW;  //  
                                       number : PInteger;                //  
                                       view   : Reference )              //   
                                       : Reference; stdcall;


//   - 713
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetArrowView( par    : PAssociationViewParam;  //   
                                 number : PInteger;               //  
                                 obj    : Reference )             //    " "
                                 : Reference; stdcall;


//   - 696
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetArrowViewW( par    : PAssociationViewParamW; //   
                                  number : PInteger;               //  
                                  obj    : Reference )             //    " "
                                  : Reference; stdcall;


//   - 714
//--------------------------------------------------------------------------
//    \
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetSectionView( par    : PAssociationViewParam;  //   
                                   number : PInteger;                 //  
                                   obj    : Reference )               //     
                                   : Reference; stdcall;


//   - 797
//--------------------------------------------------------------------------
//    \
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetSectionViewW( par    : PAssociationViewParamW; //   
                                    number : PInteger;               //  
                                    obj    : Reference )             //     
                                    : Reference; stdcall;


//   - 715
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetRemoteView( par    : PAssociationViewParam;  //   
                                  number : PInteger;               //  
                                  obj    : Reference )             //    "  "
                                  : Reference; stdcall;


//   - 798
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
function ksCreateSheetRemoteViewW( par    : PAssociationViewParamW; //   
                                   number : PInteger;               //  
                                   obj    : Reference )             //    "  "
                                   : Reference; stdcall;


//   - 758
//-------------------------------------------------------------------------------
//   .   : SAFEARRAY double (VT_ARRAY | VT_R8)
//     16 ,     44.
// ---
function ksAssociationViewMatrix3D( view : reference ) : Variant; stdcall;


//   - 759
//-------------------------------------------------------------------------------
//   3D     
//  1 -   , 0 -   
// ---
function ksPoint3DToAssociationView( view : Reference;                        //    
                                     x3D, y3D, z3D : Double;                  //  3D 
                                     x2D, y2D : PDouble ) : Integer; stdcall; //  -    

//   - 77 kAPI2D5.dll
//--------------------------------------------------------------------------
//         .
//    c   ,   0.
//--------------------------------------------------------------------------
function GetViewReference( number : Integer ) : Reference; stdcall;

//   - 78 kAPI2D5.dll
//--------------------------------------------------------------------------
//        ;
//       -1.      0.
//  p- ,     .
//--------------------------------------------------------------------------
function GetViewNumber( p : Reference ) : Integer; // p  -     
                        stdcall;

//   - 79 kAPI2D5.dll
//--------------------------------------------------------------------------
//    ,    .    .
//   1   , 0    .
//--------------------------------------------------------------------------
function OpenView( number : Integer ) : Reference;    //number -  
                   stdcall;

//   - 127 kAPI2D5.dll
//--------------------------------------------------------------------------
//       0  .
//--------------------------------------------------------------------------
function NewViewNumber : Integer; stdcall;

//   - 80 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .      , 
//  .
//--------------------------------------------------------------------------
function Layer( n : Integer ) : reference;             //n -  
                stdcall;

//   - 81 kAPI2D5.dll
//--------------------------------------------------------------------------
//        .
//      -1.      0.
//  p - ,     .
//--------------------------------------------------------------------------
function GetLayerNumber( p : Reference ) : Integer; //p -     
                         stdcall;

//   - 82 kAPI2D5.dll
//--------------------------------------------------------------------------
//          .
//    c   ,   0.
//--------------------------------------------------------------------------
function GetLayerReference( number : Integer ) : Reference; //number -  
                            stdcall;

//   - 172 kAPI2D5.dll
//--------------------------------------------------------------------------------------------
//    .       
//   (    )
//   1   , 0 - 
//--------------------------------------------------------------------------------------------
function ChangeObjectLayer( obj    : Reference;            //  
                            number : Integer ) : Integer;  //-  ,   
                            stdcall;

//   - 221    kAPI2D5.dll
//--------------------------------------------------------------------------
//          
//  docsArr -    ,   
//    1     0  .
//--------------------------------------------------------------------------
function ksPrintPreviewWindow( docsArr : Reference;             //    CHAR_STR_ARR  CHAR_STR_ARR_W
                               inquiry : Integer   ) : Integer; // 1 -   docsArr = 0       
                                                                // 0 -  
                               stdcall;


//   - 222    kAPI2D5.dll
//--------------------------------------------------------------------------
//   -     
//--------------------------------------------------------------------------
function ksDrawKompasDocument( HWindow     : HWND;              //  
                               docFileName : PChar ) : Integer; //    
                               stdcall;


//   - 222    kAPI2D5.dll
//--------------------------------------------------------------------------
//   -     
//--------------------------------------------------------------------------
function ksDrawKompasDocumentW( HWindow     : HWND;                  //  
                                docFileName : PWideChar ) : Integer; //    
                                stdcall;


//   - 719
//------------------------------------------------------------------------------
//  -     
// ---
function ksDrawKompasDocumentByReference( HWindow : HWND;       //  
                                          pDoc    : Reference ) //   
                                          : Integer; stdcall;

//   - 241
//--------------------------------------------------------------------------
//        
//--------------------------------------------------------------------------
function ksDrawKompasGroup ( HWindow : HWND;               //  
                             gr      : Reference ) : Integer; //
                             stdcall;


//   - 227    kAPI2D5.dll
//---------------------------------------------------------------------------
//  ,  ,    *.tbl
//---------------------------------------------------------------------------
function ksReadTableFromFile( tblFileName : PChar ) : Reference; //    
                              stdcall;


//   - 802    kAPI2D5.dll
//---------------------------------------------------------------------------
//  ,  ,    *.tbl
//---------------------------------------------------------------------------
function ksReadTableFromFileW( tblFileName : PWideChar ) : Reference; //     
                              stdcall;


//   - 74    kAPI2D5.dll
//--------------------------------------------------------------------------
//    ,   ,
//   .
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksEditViewObject.
//       0   
//--------------------------------------------------------------------------
function ksViewGetObjectArea : Reference; stdcall;

//   - 232    kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//      
//     .
//       VariableParam  0   
//----------------------------------------------------------------------------------------------
function ksGetDocVariableArray( p : Reference ) : Reference; //     
                                stdcall;

//   - 233    kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//          
//     .
//  1     0   
//----------------------------------------------------------------------------------------------
function ksSetDocVariableArray( obj    : Reference;         //      
                                arr    : Reference;         //     VARIABLE_ARR
                                setNote: Byte ) : Integer;  // 0 -    1  
                                stdcall;

//   - 97    kAPI2D5.dll
//------------------------------------------------------------------------------
//   .
//   1    0   
// ---
function  ksSetObjConstraint( obj : Reference;
                              par : PConstraintParam ) : Integer; stdcall;

//   - 99    kAPI2D5.dll
//------------------------------------------------------------------------------
//   ,   .
//        ConstraintParam.
//         0
// ---
function  ksGetObjConstraints( obj : Reference ) : Reference;//   
                             stdcall;

//   - 103   kAPI2D5.dll
//------------------------------------------------------------------------------
//   .
//   1    0   
// ---
function  ksDestroyObjConstraint( obj : Reference;
                                  par : PConstraintParam ) : Integer; stdcall;

//   - 255 kAPI2D5.dll
//--------------------------------------------------------------------------
//       -  
//  m = 0 -  
// angl -     OX     
//      1,    - 0
//      (    SetMacroPlacement ) - 
//  -1
//--------------------------------------------------------------------------
function  GetMacroPlacement( macro : Reference;
                             Var x, y, angl : Double ) : Integer;
                             stdcall;

//   - 994
//--------------------------------------------------------------------------
//    ksGetMacroPlacement,       
// *mirrorSymmetry = 0 -   
// *mirrorSymmetry = 1 -      
// mirrorSymmetry = NULL -  
//--------------------------------------------------------------------------
function ksGetMacroPlacementEx( macro : Reference;
                                Var x, y, angl : Double;
                                sheetParam : Byte;
                                mirrorSymmetry : PByte ) : Integer;   //   
                                 stdcall;

//   - 257 kAPI2D5.dll
//--------------------------------------------------------------------------
//       -   
// angl -     OX     
// relativ = 1 - (x, y, angl) -    ..  
// relativ = 0 - (x, y, angl) -    .. 
//--------------------------------------------------------------------------
function  SetMacroPlacement( macro : Reference;
                             x, y, angl : Double; relativ : Integer ) : Integer;
                             stdcall;

//   - 995
//--------------------------------------------------------------------------
//    SetMacroPlacement,       
// mirrorSymmetry = 0 -   
// mirrorSymmetry = 1 -      
// mirrorSymmetry   . ksGetMacroPlacementEx
//--------------------------------------------------------------------------
function ksSetMacroPlacementEx( macro : Reference;
                                x, y, angl : Double; relative : Integer;
                                mirrorSymmetry : Byte ) : Integer; //   
                                stdcall;

//   - 109 kAPI2D5.dll
//------------------------------------------------------------------------------
//     ()   .
//  :
//  0  -  (   ,      );
//  -1 -       ;
//  1  -  .
// ---
function ksGetZona( x, y : Double;              // x,y -     ;
                    zona : PChar;               //    ;
                    size : Integer ) : Integer; //   
                    stdcall;


//   -  kAPI2D5.dll
//------------------------------------------------------------------------------
//     ()   .
//  :
//  0  -  (   ,      );
//  -1 -       ;
//  1  -  .
// ---
function ksGetZonaW( x, y : Double;              // x,y -     ;
                     zona : PWideChar;           //    ;
                     size : Integer ) : Integer; //   
                     stdcall;


//------------------------------------------------------------------------------
//     (      )  
//    grRegion.
// grClear  -  ,     0 -     
// GrRegion -  ,   
// ---
function ksClearRegion( grClear : Reference; grRegion : Reference; inside : Byte  ) : Integer;
                             stdcall;

//   - 33 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//        ,   
//      x1,y1, x2,y2 .     
//------------------------------------------------------------------------------------------------
function ksZoom ( x1, y1, x2, y2 : Double ) : Integer; stdcall;

//   - 34 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//        ,    
//    .     
//------------------------------------------------------------------------------------------------
function ksZoomScale ( x, y, scale : Double ) : Integer; stdcall;

//   - 35 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//   / ""       
//------------------------------------------------------------------------------------------------
function ksZoomPrevNextOrAll ( _type : Byte ) : Integer; //0-  Zoom,1-  Zoom,2- 
                               stdcall;

//   - 85 kAPI2D5.dll
//------------------------------------------------------------------------------
//        
// ---
function ksGetZoomScale ( Var x, y, scale : Double ) : Integer; //      
                          stdcall;

//   - 37 kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//        
//------------------------------------------------------------------------------------------------
function ksRefreshActiveWindow : Integer; stdcall;

//------------------------------------------------------------------------------
//        
//  1           
//           
//  .
// ---
function  IsVisibleOrHiddenArraysInObject( obj : Reference ) : Integer;  stdcall;

//------------------------------------------------------------------------------
//  1       .
// ---
function  IsObjFromAssociativeView( obj : Reference ) : Integer;  stdcall;

//------------------------------------------------------------------------------
//  1     
// ---
function  IsGeomObject( obj : Reference ) : Integer;  stdcall;

//   - 280 kAPI2D5.dll
//------------------------------------------------------------------------------
//       
// ---
function ksGetCursorLimit : Double; stdcall;

//   - 295    kAPI2D5.dll
//-----------------------------------------------------------------------------
//       .
//      ,    .
// deleteOldCurve - true  curve    ,
//                  false  curve     .
//      ,  0   .
//-----------------------------------------------------------------------------
function ksTrimCurve( curve : Reference;          // 
                      x1, y1,                     //  
                      x2, y2,                     //  
                      x3, y3 : Double;            //  
                      deleteOldCurve : Byte ) : Reference;    //    
                      stdcall;

//   - 299    kAPI2D5.dll
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL  
//               ,
// scale    - ,     
//   0   .
// ---
function ksPrintKompasDocument( fileName : PChar; toFile : PChar;
                                scale : Double ) : Integer;
                                stdcall;


//   - 883  kAPI2D5.dll
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL  
//               ,
// scale    - ,     
//   0   .
// ---
function ksPrintKompasDocumentW( fileName : PWideChar; toFile : PWideChar;
                                 scale : Double ) : Integer;
                                stdcall;

//   - 299    kAPI2D5.dll
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL  
//               ,
// scale    - ,     
// fKompasPrint = 1 true   , 0 -   Windows
//   0   .
// ---
function ksPrintKompasDocumentEx( fileName : PChar; toFile : PChar;
                                  scale : Double; fKompasPrinter : Integer ) : Integer;
                                stdcall;


//   - 883  kAPI2D5.dll
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL  
//               ,
// scale    - ,     
// fKompasPrint = 1 true   , 0 -   Windows
//   0   .
// ---
function ksPrintKompasDocumentExW( fileName : PWideChar; toFile : PWideChar;
                                 scale : Double; fKompasPrinter : Integer ) : Integer;
                                stdcall;


//   - 702
//-------------------------------------------------------------------------------
//            
//   ,  ,      
//  /   -
//   0   .
//-------------------------------------------------------------------------------
function ksGetLeaderShelfLength( p : Reference;    //  
                                 var x, y : Double //  
                                ) : Double; stdcall;


//   - 954
//-------------------------------------------------------------------------------
//          
//   ,  ,     
//  /   -  
//-------------------------------------------------------------------------------
function ksGetShelfPoint(  p : Reference; index : Integer; var x, y : Double; paramType : Integer ) : Double; stdcall;


//   - 716
//-------------------------------------------------------------------------------
//   
//   DocType "ldefin2d.h"
// ---
function ksGetDocumentType( doc : reference ) : Integer; stdcall;

//   - 722
//-------------------------------------------------------------------------------
//     DocType "ldefin2d.h"    
// 0   
//-------------------------------------------------------------------------------
function ksGetDocumentTypeByName( fileName : PChar ) : Integer; stdcall;


//   - 722
//-------------------------------------------------------------------------------
//     DocType "ldefin2d.h"    
// 0   
//-------------------------------------------------------------------------------
function ksGetDocumentTypeByNameW( fileName : PWideChar ) : Integer; stdcall;


//   - 725
//-----------------------------------------------------------------------------
//     COM
// ifType      -    ksNotifyType
// object      -   
// pContainer  -    ,  
// ---
function ksConnectionAdvise ( param : PNotifyConnectionParam; object_ : PIUnknown ) : Integer; stdcall;

//   - 726
//-----------------------------------------------------------------------------
//      COM
// ifType      -    ksNotifyType
// pContainer  -    ,  
// ---
function ksConnectionUnadvise ( param : PNotifyConnectionParam ) : Integer; stdcall;

//-------------------------------------------------------------------------------
//   
// group -   ,
// obj - ,    
// orderType -     /*ChangeOrderType*/
//  1   ,  0 -   
// ---
function ksChangeObjectsOrder( group : Reference; obj : reference; orderType : Integer ) : Integer; stdcall;

//   - 736
//  [17/5/2004]
//-------------------------------------------------------------------------------
//     
//  :
// 1 -    , 0 - 
//  :
// doc -   
//      
// ---
function ksGetOrthoMode( doc : Reference ) : Integer; stdcall;

//   - 737
//  [17/5/2004]
//-------------------------------------------------------------------------------
//    
//  :
// 1   , 0 -   
//  :
// doc -   
// orthoMode -    ( 1 - , 0 -  )
//      
// ---
function ksSetOrthoMode( doc : Reference; orthoMode : Integer ): Integer; stdcall;

//   - 741
//  [26/5/2004]
//-----------------------------------------------------------------------------
//     DblClick   
//  :
// 1 -   DblClick , 0 - 
//  :
// ref -   
// ---
function ksGetMacroWaitDblClickEdit( ref : Reference ) : Integer; stdcall;

//   - 742
//  [26/5/2004]
//-------------------------------------------------------------------------------
//    DblClick   
//  :
// 1 -   , 0 -   
//  :
// ref -   
// waitDblClick -   DblClick ( 1 - , 0 -  )
// ---
function ksSetMacroWaitDblClickEdit( ref : Reference; waitDblClick : Integer ) : Integer; stdcall;


////////////////////////////////////////////////////////////////////////////////
//
//  " ". LT_MODEL.h
//
////////////////////////////////////////////////////////////////////////////////

//   - 22 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   4.10.97    
//   " ".   .
//       " ".
//-------------------------------------------------------------------------------
function SpecRough( _type : Byte;                //  0- -  - 1- -   
                                                 // 2 --    
                    t     : Byte;                //1-     0 -
                    s     : PChar ) : Reference; //
                    stdcall;

//   - 58 kAPI2D5.dll
//-------------------------------------------------------------------------------
//  "."  
//-------------------------------------------------------------------------------
function ksSpecRough( par : PSpecRoughParam ) : Reference; //   
                      stdcall;


//   - 58 kAPI2D5.dll
//-------------------------------------------------------------------------------
//  "."  
//-------------------------------------------------------------------------------
function ksSpecRoughW( par : PSpecRoughParamW ) : Reference; //   
                       stdcall;


//   - 49 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function Point( x,y : Double;               // 
                style : Word ) : Reference; //   
                stdcall;

//   - 45 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function LineSeg( x1, y1,                      //  
                  x2, y2 : Double;             //  
                  style  : Word ) : Reference; //   
                  stdcall;

//   - 31 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   
// 0   
// 1   
// 2   
// 3      (   )
// 4     
// 5     
// 6      (7)
// 7     (  4     45  )
// 8     
// 9     2   
// 10       
// 11  
// 12  
// 13  
// 14     
// 15     
// 16   
// 17     ( )
// 18    
// 19                
// 20                
// 21                
// 22                
// 23  90                
// 24  90                
// 25    
// 26   0.6    
//      (          
//----------------------------------------------------------------------------------------------
function AnnLineSeg( x1, y1,                             //  
                     x2, y2       : Double;              //  
                     term1, term2 : Byte;                //    
                     style        : Word ) : Reference;  //  
                     stdcall;

//   - 966
//-------------------------------------------------------------------------------
//    " "   
// ---
function ksAnnPolylineEx( par : PPolylineParamEx; term1, term2 : Byte ) : Reference;  stdcall;


//   - 967
//-------------------------------------------------------------------------------
//    "  "
// ---
function ksAnnEllipseArc( par : PEllipseArcParam; term1, term2 : Byte ) : Reference;  stdcall;


//   - 968
//-------------------------------------------------------------------------------
//    "  "  
// ---
function ksAnnParEllipseArc( par : PEllipseArcParam1; term1, term2 : Byte ) : Reference;  stdcall;

//   - 969
//-------------------------------------------------------------------------------
//    " "
// ---
function ksAnnCircle( xc, yc,  rad : Double; style : Word ) : Reference;  stdcall;


//   - 970
//-------------------------------------------------------------------------------
//    " "
// ---
function ksAnnEllipse( par : PEllipseParam ) : Reference;  stdcall;


//   - 971
//-----------------------------------------------------------------------------
//    .
//   .  Point,    ksAnnPolyline
//   EndObj,   . EndObj    .
// ---
function ksAnnPolyline( style : Word; term1, term2 : Byte ) : Integer; stdcall;


//   - 750
//----------------------------------------------------------------------------
//      
// align -   -  0 - , 1 -  ,2 - , 3 -   
// align - -1      
//----------------------------------------------------------------------------
function ksAnnTextEx( txtParam : PTextParam; align : Integer ) : Reference;  stdcall;


//   - 49
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function ksAnnPoint( x, y : Double;                       //  
                     style : Word ): Reference;  stdcall; //    
                                                          // 0-,1 - ,2 --,3-,4-,5-,6-,7- ,8 -  

//-----------------------------------------------------------------------------
//       
// ---
function ksGetAnnObjTerminators( annObj : Reference; var term1 : WORD; var term2 : WORD ) : Integer;  stdcall;


//-----------------------------------------------------------------------------
//     2D 
//     
//    
// ---
function ksGetObjectStyle( obj : Reference ) : Integer;  stdcall;


//-----------------------------------------------------------------------------
//     2D 
//     
//  1  
// ---
function ksSetObjectStyle( obj : Reference; style : Word ) : Integer;  stdcall;

//   - 61 kAPI2D5.dll
//----------------------------------------------------------------------------------------------
//       
//    .   AnnLineSeg
//----------------------------------------------------------------------------------------------
function PointArraw( x, y,                       //   
                     ang  : Double;              //   
                     term : Byte ) : Reference;  //   
                     stdcall;

//   - 32 kAPI2D5.dll
//------------------------------------------------------------------------------
//          
//       PointArraw   
//    .   AnnLineSeg
//------------------------------------------------------------------------------
function AnnArcByPoint( xc, yc,                            // 
                        rad,                               // 
                        x1, y1,                            //  
                        x2, y2       : Double;             //  
                        direction    : SmallInt;           //  
                        term1, term2 : Byte;               //    
                        style        : Word ) : Reference; //  
                        stdcall;

//   - 46 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function Line( x, y,                             //  
               angle : Double ) : Reference;     //    X  .
               stdcall;

//   - 51 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   ""    .
//     "".
//-------------------------------------------------------------------------------
function ArcByAngle( xc, yc,                        // 
		     rad,                           // 
		     f1, f2    : Double;            //   
		     direction : SmallInt;          //  
		     style     : Word ) : Reference;//  
                     stdcall;

//   - 7 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    ""   .
//      "".
//-------------------------------------------------------------------------------
function ArcBy3Points( x1, y1,  //  
                       x2, y2,  //  
                       x3, y3 : Double;  //  
                       style : Word ) : Reference;  //  
                       stdcall;

//   - 52 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    ""     .
//      "".
//-------------------------------------------------------------------------------
function ArcByPoint( xc, yc,                         // 
                     rad,                            // 
        	     x1, y1,                         //  
                     x2, y2    : Double;             //  
                     direction : SmallInt;           //  
		     style     : Word ) : Reference; //  
                     stdcall;

//   - 53 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function Circle( xc,yc,                      // 
                 rad   : Double;             // 
                 style : Word ) : Reference; //  
                 stdcall;

//   - 132 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function ksEllipse( par : PEllipseParam ) : Reference; // 
                    stdcall;

//   - 42 kAPI2D5.dll
//-------------------------------------------------------------------------------
//      
//-------------------------------------------------------------------------------
function ksEllipseArc( par : PEllipseArcParam ) : Reference; stdcall;

//   - 133 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "".
//      "".
//-------------------------------------------------------------------------------
function Equidistant( par : PEquidistantParam  ) : Reference; // 
                      stdcall;

//   - 30 kAPI2D5.dll
//--------------------------------------------------------------------------------
///  Nurbs       
//--------------------------------------------------------------------------------
function NurbsForConicCurve( x     : Double4;
                             y     : Double4;
                             style : Word ) : Reference;
                             stdcall;

//   - 298
//-------------------------------------------------------------------------------
//   " "
// ---
function ksAxisLine( param : PAxisLineParam ) : Reference; stdcall;

//   - 83 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   .
//   .  TextLine,    Paragraph 
//  EndObj,    .
//  ,     ,    
//   .     .
//  EndObj    .
//-------------------------------------------------------------------------------
function Paragraph( par : PParagraphParam ) : Integer;    //par-  
                    stdcall;

//   - 84 kAPI2D5.dll
//-------------------------------------------------------------------------------
//  ()  .
//         
//     .
//    .
// bitVector      |   
// [INVARIABLE ...NEW_LINE] . ltdefine.h.
//-------------------------------------------------------------------------------
function TextLine( bitVector : Cardinal;          // ,   .-.
                   tip       : Integer;           //  ,   
                   value     : Pointer;           //    
                   s         : PChar ) : Integer; // 
                   stdcall;


//   - 827 kAPI2D5.dll
//-------------------------------------------------------------------------------
//  ()  .
//         
//     .
//    .
// bitVector      |   
// [INVARIABLE ...NEW_LINE] . ltdefine.h.
//-------------------------------------------------------------------------------
function TextLineW( bitVector : Cardinal;          //  ,   .-.
                    tip       : Integer;           //   ,   
                    value     : Pointer;           //     
                    s         : PWideChar ) : Integer; // 
                    stdcall;


//   - 283
//-------------------------------------------------------------------------------
//    
//---------------------------------------------------------------------------
function ksSetTextLineAlign( align : Cardinal ) : Integer; stdcall; //   

//   - 85 kAPI2D5.dll
//----------------------------------------------------------------------------
//    .
// bitVector      |. 
// :  ITALIC_ON (   ),BOLD_ON ( ),
// UNDERLINE_ON ( ). . ltdefine.h.
//    , ,   
//  4- :
//  - $   ;   $
//       - $d  ;  $
//    - &nn   0 - 99
//----------------------------------------------------------------------------
function ksText( x, y,                             //  
                 ang,                              //  
                 hStr,                             // 
                 ksuStr    : Double;               // 
                 bitVector : Cardinal;             // ,   .-.
                 s         : PChar ) : Reference;  // 
                 stdcall;

//   - 85 kAPI2D5.dll
//----------------------------------------------------------------------------
//    .
// bitVector      |. 
// :  ITALIC_ON (   ),BOLD_ON ( ),
// UNDERLINE_ON ( ). . ltdefine.h.
//    , ,   
//  4- :
//  - $   ;   $
//       - $d  ;  $
//    - &nn   0 - 99
//----------------------------------------------------------------------------
function ksTextW( x, y,                                //   
                  ang,                                 //   
                  hStr,                                //  
                  ksuStr    : Double;                  //  
                  bitVector : Cardinal;                //  ,   .-.
                  s         : PWideChar ) : Reference; //  
                 stdcall;

//   - 750
//----------------------------------------------------------------------------
//      
// align -   -  0 - , 1 -  ,2 - , 3 -   
// align - -1      
//----------------------------------------------------------------------------
function ksTextEx( txtParam : PTextParam; align : Integer ) : Reference; stdcall;

//   - 96 kAPI2D5.dll
//--------------------------------------------------------------------------
//     
//      ,   
//--------------------------------------------------------------------------
function ksConvertTextToCurve( text : Reference ) : Reference;  stdcall;

//   - 42 kAPI2D5.dll
//-------------------------------------------------------------------------------
//   .
//   .  ,    Contour  EndObj,
//   .
//      , ,     , 
//           
//   . EndObj    .
//-------------------------------------------------------------------------------
function Contour( style : Word ) : Integer;  // 
                  stdcall;


//   - 43 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//   .  ,    Macro  EndObj,
//   .  EndObj    .
//--------------------------------------------------------------------------------
function Macro( _type : Byte ) : Integer;  //0-   , 1-  
                stdcall;

//   - 195 kAPI2D5.dll
//---------------------------------------------------------------------------
//    
//       macro   ,
//   FindObj
//    EndObj();
//---------------------------------------------------------------------------
function ksOpenMacro( macro : Reference ) : Integer; stdcall;

//   - 44 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .      .
//--------------------------------------------------------------------------------
function EndObj : Reference; stdcall;


//   - 264 kAPI2D5.dll
//------------------------------------------------------------------------------
//          
//      ,    ( ).
//          0,   
//     
// ---
function ksMakeEncloseContours( gr   : Reference;         //   0,     
                                x, y : Double ) : Reference; stdcall; //   

//   - 965
//------------------------------------------------------------------------------
//          
//      ,    ( ).
//          0,   
//     
// forHatch == 1 - C          
//                     
// ---
function ksMakeEncloseContoursEx( gr   : Reference;                          //    0,     
                                  x, y : Double;                             //    
                                  forHatch : Integer ) : Reference; stdcall; //    

//   - 47 kAPI2D5.dll
//--------------------------------------------------------------------------------
//   .
//   .  ,    Hatch  EndObj,
//       .
//  EndObj    .
//--------------------------------------------------------------------------------
function Hatch( style  : Word;               // 
                angle,                       //   .
                step,                        // 
		            width,                       //     
		            x0, y0 : Double ) : Integer; //  
                stdcall;

//--------------------------------------------------------------------------------
//   .
//   .  ,    HatchEx  EndObj,
//       .
//  EndObj    .
//--------------------------------------------------------------------------------
function HatchEx( style : SmallInt;  // 
                  angle,             //   .
                  step,              // 
                  width,             //     
		  x0, y0 : Double;   //  
                  color  : Cardinal; // FREE_COLOR (0xff000000l)
                  sheetAng : Byte ) : Integer; // 0 -     (  ) 1 -  (  )
                  stdcall;

//   - 265 kAPI2D5.dll
//------------------------------------------------------------------------------
//      
// ---
function ksHatch( par : PHatchParam ) : Reference; stdcall;

//------------------------------------------------------------------------------
//     
//         
// ---
function ksHatchEx( par : PHatchParamEx ) : Reference;  stdcall;

//   - 211 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     
//   .  ,    ksColouring  EndObj,
//       .
//  EndObj    .
//--------------------------------------------------------------------------------
function ksColouring( color : DWord ) : Integer; stdcall;

//   - 752
// 21.09.2004
//--------------------------------------------------------------------------------
//     
//     group   
//     .
//--------------------------------------------------------------------------------
function ksColouringEx( color : DWord; group : Reference ) : Reference; stdcall;

//------------------------------------------------------------------------------
//          
// ---
function ksDuplicateBoundaries( p : reference ) : reference; //    
                                stdcall;
//------------------------------------------------------------------------------
//          
// p -     
// systemCoord - 1 -    , 0 -     
// ---
function ksDuplicateBoundariesEx( p : reference ; systemCoord : Byte ) : reference;
                                  stdcall;

//   - 50 kAPI2D5.dll
//--------------------------------------------------------------------------------
//        Bezier-.
//--------------------------------------------------------------------------------
function BezierPoint( par : PBezierPointParam ) : Integer;  //       Bezier - 
                      stdcall;

//   - 145 kAPI2D5.dll
//--------------------------------------------------------------------------------
//        Nurbs-.
//--------------------------------------------------------------------------------
function NurbsPoint( par : PNurbsPointParam ) : Integer; stdcall;

//   - 246 kAPI2D5.dll
//------------------------------------------------------------------------------
//        Nurbs .
// ---
function ksNurbsKnot( knot : double ) : integer;

//   - 48 kAPI2D5.dll
//--------------------------------------------------------------------------------
//   Bezier-.
//  .  BezierPoint,    Bezier 
// EndObj,  . EndObj    Bezier-.
//--------------------------------------------------------------------------------
function Bezier( closed : Byte;  //   0 -  1 - 
                 style  : Word ) : Integer;  //  
                 stdcall;

//   - 6 kAPI2D5.dll
//--------------------------------------------------------------------------
//      Bezier-.    Bezier .
//--------------------------------------------------------------------------
function _Bezier( par         : PBezierPointParam;   // ,  
                  countPoints : Integer;                   //   
                  closed      : Byte;                 //   0 -  1 - 
                  style       : Word  ) : Reference;   //  
                  stdcall;

//   - 144 kAPI2D5.dll
//--------------------------------------------------------------------------------
//   Nurbs-.
//  .  NurbsPoint,    Nurbs 
// EndObj,  e.  EndObj    Nurbs-.
//--------------------------------------------------------------------------------
function Nurbs ( degree : Byte;    //  > 2 && < 9
                 close  : Byte;     //   0 -  1 - 
                 style  : Word ) : Integer;    //  
                 stdcall;

//   - 169 kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//      
//      ,  , nurbs
//-------------------------------------------------------------------------------------------------
function ksConicArc( par : PConicArcParam ) : Reference; //  
                     stdcall;

//   - 100 kAPI2D5.dll
//------------------------------------------------------------------------------
//   " "
// ---
function ksCentreMarker( par : PCentreParam ) : Reference;
                         stdcall;

//   - 101 kAPI2D5.dll
//------------------------------------------------------------------------------
//   ""
// ---
function ksRectangle( par : PRectangleParam;  // 
                      centre : Byte ) : Reference;//   0 -   1- , 2-   3-  
                      stdcall;

//   - 102 kAPI2D5.dll
//------------------------------------------------------------------------------
//   " "
// ---
function ksRegularPolygon( par : PRegularPolygonParam; // 
                           centre : Byte ) : Reference;    //   0 -   1- , 2-   3-  
                           stdcall;

//   - 111 kAPI2D5.dll
//------------------------------------------------------------------------------
//   
// ---
function ksInsertRaster( par : PRasterParam ) : Reference; stdcall;


//   - 829 kAPI2D5.dll
//------------------------------------------------------------------------------
//   
// ---
function ksInsertRasterW( par : PRasterParamW ) : Reference; stdcall;


//   - 148 kAPI2D5.dll
//--------------------------------------------------------------------------
//    .
//   .  Point,    ksPolyline
//   EndObj,  . EndObj    .
//--------------------------------------------------------------------------
function ksPolyline( style : Word ) : Integer;     //  
                     stdcall;

//   - 23 kAPI2D5.dll
//--------------------------------------------------------------------------
//           .
//--------------------------------------------------------------------------
function _ksPolyline( par : PPolylineParam ) : Reference; stdcall;

//--------------------------------------------------------------------------
//     
//--------------------------------------------------------------------------
function ksPolylineEx( par : PPolylineParamEx ) : Reference; stdcall;

//   - 135 kAPI2D5.dll
//------------------------------------------------------------------------------
//      
//    -1   , 0  -  ,  1 -  
// ---
function ksIsCurveClosed( p : reference ) : integer; stdcall; //  

//   - 135 kAPI2D5.dll
//--------------------------------------------------------------------------------
//   .
//   . ,    Table  EndObj
//   .   - , .   
//    .
//     :  1-, 2-, 7-, 0-
//  EndObj    .
//--------------------------------------------------------------------------------
function Table : Integer; stdcall;

//   - 183 kAPI2D5.dll
//---------------------------------------------------------------------------
//    -   
//---------------------------------------------------------------------------
function ksOpenTable( table : Reference  ) : Integer; stdcall;

//   - 192 kAPI2D5.dll
//---------------------------------------------------------------------------
//                      ksOpenTable()  ksOpenTolerance();
//                ksRebuildTableVirtualGrid(..);
//                                  EndObj();
//      -  ,   
// ,   .    ,   
//     .
//            .
//        
//---------------------------------------------------------------------------
function ksRebuildTableVirtualGrid : Integer; stdcall;

//   - 193 kAPI2D5.dll
//---------------------------------------------------------------------------
//      
// (    )                              ksOpenTable()  ksOpenTolerance();
//                ksGetTableItemsCount(..);
//                                  EndObj();
//---------------------------------------------------------------------------
function ksGetTableItemsCount( _type : Byte ) : Integer; //0-   ,1-   ,2-   
                               stdcall;

//   - 186 kAPI2D5.dll
//---------------------------------------------------------------------------
//    ,     
//         ColumnNumber,    
// .
//         - TEXT_LINE_ARR
//  0,                 ksOpenTable(..);
//   numb != NULL -                    ksGetTableColumnText(..);
//              EndObj();
//    
//---------------------------------------------------------------------------
function ksGetTableColumnText( Var numb : Cardinal;
                               par      : PTextParam ) : Integer; stdcall;

//   - 237 kAPI2D5.dll
//---------------------------------------------------------------------------
//     ,                      ksOpenTable(..);
//  1     0              ksSetTableColumnText(..);
//              EndObj();
//---------------------------------------------------------------------------
function ksSetTableColumnText( numb : Cardinal;
                               par  : PTextParam ) : Integer;
                               stdcall;

//   - 187 kAPI2D5.dll
//---------------------------------------------------------------------------
//      
//  numb = 0    
//    1                               ksOpenTable()  ksOpenTolerance();
//         ksClearTableColumnText(..);
//                                         EndObj();
//---------------------------------------------------------------------------
function ksClearTableColumnText( numb : Cardinal  ) : Integer; stdcall;

//   - 188 kAPI2D5.dll
//---------------------------------------------------------------------------
//    ,     
//    1                               ksOpenTable()  ksOpenTolerance();
//                ksCombineTwoTableItems(..);
//                                  EndObj();
//---------------------------------------------------------------------------
function ksCombineTwoTableItems( index1 : Cardinal;             //  
                                 index2 : Cardinal ) : Integer;  //  
                                 stdcall;


//   - 189 kAPI2D5.dll
//---------------------------------------------------------------------------
//   ,
//    1                               ksOpenTable()  ksOpenTolerance();
//                ksDivideTableItem(..);
//                                  EndObj();
//---------------------------------------------------------------------------
function ksDivideTableItem( index    : Cardinal;          // 
                            vertical : Byte;              //1 -  0 -
                            style    : Word ) : Integer;  //  0-, 1-, 2-,7-
                            stdcall;

//   - 190 kAPI2D5.dll
//---------------------------------------------------------------------------
//    
//    1                               ksOpenTable()  ksOpenTolerance();
//                ksSetTableBorderStyle(..);
//                                  EndObj();
//  1 -  0 - 
//---------------------------------------------------------------------------
function ksSetTableBorderStyle( index      : Cardinal;         // 
                                typeBorder : Byte;             //  0-,1-,2-,3-
                                style      : Word ) : Integer; //  0-, 1-, 2-,7-
                                stdcall;

//   - 191 kAPI2D5.dll
//---------------------------------------------------------------------------
//     
//    1                               ksOpenTable()  ksOpenTolerance();
//                ksGetTableBorderStyle(..);
//                                  EndObj();
//     -1   
//---------------------------------------------------------------------------
function ksGetTableBorderStyle( index      : Cardinal;        // 
                                typeBorder : Byte ) : Integer;//  0-,1-,2-,3-
                                stdcall;

//   - 8 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function LinDimension( linPar : PLDimParam ) : Reference;//  
                       stdcall;

//   - 104 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "   ".
//      "   ".
//-------------------------------------------------------------------------------
function LinBreakDimension( linPar : PLBreakDimParam ) : Reference;
                            stdcall;

//   - 9 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function DiamDimension( linPar : PRDimParam  ) : Reference; //  
                        stdcall;

//   - 10 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function RadDimension( linPar : PRDimParam ) : Reference;  //  
                       stdcall;

//   - 11 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "   ".
//      "   ".
//-------------------------------------------------------------------------------
function RadBreakDimension( linPar : PRBreakDimParam ) : Reference;  //    
                            stdcall;

//   - 12 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function AngDimension( angPar : PADimParam ) : Reference;//  
                       stdcall;

//   - 105 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "   ".
//      "   ".
//-------------------------------------------------------------------------------
function AngBreakDimension( angPar : PABreakDimParam ) : Reference;
                       stdcall;

//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function  ksOrdinatedDimension( ordPar : POrdinatedDimParam ) : Reference;  stdcall;


//   - 14 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function Rough( roughPar : PRoughParam ) : Reference;    // 
                stdcall;

//   - 15 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function Leader( leaderPar : PLeaderParam ) : Reference;  //  
                 stdcall;

//   - 16 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "  ".
//      "  ".
//-------------------------------------------------------------------------------
function PositionLeader( leaderPar : PPosLeaderParam ) : Reference; //   
                         stdcall;

//   - 17 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "    ".
//      "    ".
//-------------------------------------------------------------------------------
function BrandLeader( leaderPar : PBrandLeaderParam ) : Reference; //     
                      stdcall;

//   - 18 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    "    ".
//      "    ".
//-------------------------------------------------------------------------------
function MarkerLeader( leaderPar : PMarkerLeaderParam ) : Reference; //     
                       stdcall;

//   - 953
//-------------------------------------------------------------------------------
//     .
//      " ".
//-------------------------------------------------------------------------------
function ChangeLeader( leaderPar : PChangeLeaderParam ) : Reference; //  
                       stdcall;


//   - 19 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function Base( par : PBaseParam ) : Reference;//  
               stdcall;


//   - 832 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function BaseW( par : PBaseParamW ) : Reference;//  
               stdcall;


//   - 20 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " /".
//      " /".
//-------------------------------------------------------------------------------
function CutLine( par : PCutLineParam ) : Reference; //  /
                  stdcall;


//   - 20 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " /".
//      " /".
//-------------------------------------------------------------------------------
function CutLineW( par : PCutLineParamW ) : Reference; //  /
                   stdcall;


//   - 21 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function ViewPointer( par : PViewPointerParam ) : Reference; //  
                      stdcall;


//   - 21 kAPI2D5.dll
//-------------------------------------------------------------------------------
//    " ".
//      " ".
//-------------------------------------------------------------------------------
function ViewPointerW( par : PViewPointerParamW ) : Reference; //  
                      stdcall;


//   - 140 kAPI2D5.dll
//--------------------------------------------------------------------------------
//      " ".
//      ColumnNumber   TextLine,   
//  Tolerance   EndObj,   .
//  ColumnNumber   ,   .
//   ,       10  
//  10 .       
//  1   2  3  4  5  6  7  8  9 10
//  11 12 13 14 15 16 17 18 19 20
//  21 22 23 24 25 26 27 28 29 30
//  .............................
//  91 92 93 94 95 96 97 98 99 100
//          
//  . EndObj     .
//--------------------------------------------------------------------------------
function Tolerance( par : PToleranceParam ) : Integer; //  
                    stdcall;

//--------------------------------------------------------------------------------
//      " ".
//      ColumnNumber   TextLine,   
//  ksTolerance   EndObj,   .
//  ColumnNumber   ,   .
//   ,       10  
//  10 .       
//  1   2  3  4  5  6  7  8  9 10
//  11 12 13 14 15 16 17 18 19 20
//  21 22 23 24 25 26 27 28 29 30
//  .............................
//  91 92 93 94 95 96 97 98 99 100
//          
//  . EndObj     .
//--------------------------------------------------------------------------------
function  ksTolerance( par : PksTolerancePar ) : Integer;  stdcall;

//   - 184 kAPI2D5.dll
//---------------------------------------------------------------------------
//    -    
//---------------------------------------------------------------------------
function ksOpenTolerance( tolerance : Reference ) : Integer; stdcall;

//   - 185 kAPI2D5.dll
//---------------------------------------------------------------------------
//    ,     
//         ColumnNumber,    
// .
//  1   
//  0,        
//    par->pTextItem        ksOpenTolerance(..)
//   numb != NULL -                          ksGetToleranceColumnText(..)
//               EndObj();
//---------------------------------------------------------------------------
function ksGetToleranceColumnText( Var numb : Cardinal;                  // 
                                   par      : PTextLineParam ) : Integer;//  
                                   stdcall;

//   - 236 kAPI2D5.dll
//---------------------------------------------------------------------------
//                             ksOpenTolerance(..)
//  1     0                    ksSetToleranceColumnText(..)
//               EndObj();
//---------------------------------------------------------------------------
function ksSetToleranceColumnText( numb : Cardinal;                    // 
                                   par  : PTextLineParam ) : Integer;  //  
                                   stdcall;

//   - 214 kAPI2D5.dll
//---------------------------------------------------------------------------
//    " "         3..4..5
//                     :     :
//    .                  2     6
//    1          :     :
//  0 -                          1..8..7
//---------------------------------------------------------------------------
function ksGetPointOnToleranceTable( tolerance : Reference;                   //    
                                     entry     : Byte;                        //      
                                     point     : PMathPointParam ) : Integer; //  
                                     stdcall;

//------------------------------------------------------------------------------
//     Nurbs  - .
// ---
function ksAddPowerForm( x, y : Double ) : Integer; stdcall;

//------------------------------------------------------------------------------
//   Nurbs  - .
// ---
function ksCreatePowerArc : Integer; stdcall;

//------------------------------------------------------------------------------
//  Nurbs   tMin  tMax
// ---
function ksTrimNurbs( pObj : reference; tMin, tMax : Double ) : Integer; stdcall;

//------------------------------------------------------------------------------
//     
// dimObj  -   
// varName -  , size -      
// ---
function ksGetDimensionVariableName( dimObj : reference;
                                     varName : PChar;
                                     size: Integer ) : Integer; stdcall;



//------------------------------------------------------------------------------
//     
// dimObj  -   
// varName -  , size -      
// ---
function ksGetDimensionVariableNameW( dimObj : reference;
                                      varName : PWideChar;
                                      size: Integer ) : Integer; stdcall;


//   - 708
//-------------------------------------------------------------------------------------------------
//       
//  txtDoc = 0 -    
//-------------------------------------------------------------------------------------------------
function ksGetTxtDocumentPagesCount( txtDoc : reference ) : Integer; stdcall;

//   - 717
//-------------------------------------------------------------------------------
//    " "
//-------------------------------------------------------------------------------
function ksRemoteElement( param : PRemoteElementParam ) : reference; stdcall;

////////////////////////////////////////////////////////////////////////////////
//
//  LT_Math.h
//
////////////////////////////////////////////////////////////////////////////////


//   - 88 kAPI2D5.dll
//------------------------------------------------------------------------------
//        
//   0       , , 
//   bezier, nurbs, , ,    .
//   
// ---
function  ksApproximationCurve( p           :  reference;                   //   
                                eps         :  double   ;                   //    1e-7...1
                                curentLayer :  byte     ;                   //     0 -    1-   
                                maxRad      :  double   ;                   //  -   0-   
                                smooth      :  byte ) : reference; stdcall; // 1-   0-   

//------------------------------------------------------------------------
//
//------------------------------------------------------------------------

//------------------------------------------------------------------------
//   - 206 kAPI2D5.dll
//-----------------------------------------------------------------------------
//    
//   1,    , 0 -  
//-----------------------------------------------------------------------------
function ksEqualPoints( x1, y1,                       // 
                        x2, y2 : Double ) : Integer;  // 
                        stdcall;


//   - 54 kAPI2D5.dll
//----------------------------------------------------------------------------
//      .
//-----------------------------------------------------------------------------
function Angle( x1, y1,   // 
		x2, y2 : Double ) : Double; // 
                stdcall;

//   - 65
//------------------------------------------------------------------------------
//    .
//-------------------------------------------------------------------------------
function CosD( x : Double ) : Double;     //  x-  
               stdcall;

//   - 56 kAPI2D5.dll
//------------------------------------------------------------------------------
//    .
//-------------------------------------------------------------------------------
function SinD( x : Double ) : Double;     //  x-  
               stdcall;

//   - 57 kAPI2D5.dll
//------------------------------------------------------------------------------
//    .
//-------------------------------------------------------------------------------
function TanD( x : Double ) : Double;     //  x-  
               stdcall;

//   - 58 kAPI2D5.dll
//------------------------------------------------------------------------------
//  .      
//-------------------------------------------------------------------------------
function AtanD( x : Double ) : Double;  stdcall;

//   - 61 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------------
procedure IntersectLinSLinS( x11, y11,              //    
			                       x12, y12,              //    
                             x21, y21,              //    
			                       x22, y22   : Double;   //    
                             Var kp     : Integer;  //   
			                       Var xp, yp : Double )  //  
                             stdcall;
//------------------------------------------------------------------------------
//    .
// ---
procedure  IntersectLinSLine( x1, y1,                   //   
                              x2, y2,                   //   
                              x, y,                     //   
                              ang : Double;             //  
                              Var kp : Integer;         //  
                              Var xp, yp : Double );  stdcall; // -  

//------------------------------------------------------------------------------
//     
// ---
procedure  IntersectArcLin( xc, yc, rad,                     //     
                            f1, f2 : Double; n : Integer;    //     ,  
                            x, y, ang : Double;              //    
                            Var kp : Integer;                //  
                            Var xp, yp : Double );  stdcall;  // -  

//   - 62 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------------
procedure IntersectLinLin( x1, y1,               //    
                           angle1,               //   
                           x2, y2,               //    
			                     angle2     : Double;  //   
                           Var kp     : Integer; //   
                           Var xp, yp : Double ) //  
                           stdcall;

//   - 63 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------------
procedure IntersectCirCir( xc1, yc1,            //  
                           radius1,             //  
                           xc2, yc2,            //  
                           radius2 : Double;    //  
			                     Var kp  : Integer;   //  
                           xp, yp  : Double2 ); //  
                           stdcall;

//   - 64 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------------
procedure IntersectArcArc( xac, yac,             //  
                           rada,                 //  
                           fa1, fa2 : Double;    //     
                           directa  : SmallInt;  //  
                           xbc, ybc,             //  
                           radb,                 //  
                           fb1, fb2 : Double;    //     
                           directb  : SmallInt;  //  
                           Var kp   : Integer;   //  
			   xp, yp   : Double2 ); //  
                           stdcall;

//   - 65 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     .
//---------------------------------------------------------------------------------
procedure IntersectLinSArc( x1, y1,             //  
                            x2, y2,             //  
			    xc, yc,             // 
			    rad,                // 
			    f1, f2 : Double;    //     
			    direct : SmallInt;  // 
			    Var kp : Integer;   //  
                            xp, yp : Double2 ); //  
                            stdcall;

//   - 66 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     .
//---------------------------------------------------------------------------------
procedure IntersectLinSCir( x1, y1,             //  
	                    x2, y2,             //  
			    xc, yc,             // 
			    rad    : Double;    // 
			    Var kp : Integer;   //  
                            xp, yp : Double2 ); //  
                            stdcall;

//   - 67 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     .
//---------------------------------------------------------------------------------
procedure IntersectCirLin( xc, yc,              // 
                           rad,                 // 
                           xl, yl,              //  
                           angle  : Double;     //   .
                           Var kp : Integer;    //  
                           xp, yp : Double2 );  //  
                           stdcall;

//   - 68 kAPI2D5.dll
//--------------------------------------------------------------------------------
//     .
//---------------------------------------------------------------------------------
procedure IntersectCirArc( xcc, ycc,             // 
                           radc,                 // 
                           xac, yac,             // 
                           rada,                 // 
                           fa1, fa2 : Double;    //    
                           directa  : Integer;   // 
                           Var kp   : Integer;  //  
                           xp, yp   : Double2 ); //  
                           stdcall;

//   - 69 kAPI2D5.dll
//--------------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------------
procedure IntersectCurvCurv ( p1       : Reference; //   
                              p2       : Reference; //   
                              Var kp   : Integer;   //  
                              xp, yp   : Pointer;   //  
                              maxCount : Integer ); //-    
                              stdcall;

//   - 70  kAPI2D5.dll
//-----------------------------------------------------------------------------
//          .
//-----------------------------------------------------------------------------
procedure TanLinePointCircle( x, y,                 // 
                              xc, yc,               // 
                              rad : Double;         // 
                              Var kp : Integer;     //  
                              xp, yp : Double2 );   //  
                              stdcall;

//   - 71 kAPI2D5.dll
//-----------------------------------------------------------------------------
//         .
//-----------------------------------------------------------------------------
procedure TanLineAngCircle( xc, yc,             // 
                            rad,                // 
                            ang : Double;       //  
                            xp, yp : Double2 ); //  
                            stdcall;

//   - 158 kAPI2D5.dll
//-------------------------------------------------------------------------------
//         .
//  TAN     ,    
//  .      0  4.
//        .
//-------------------------------------------------------------------------------
function TanCircleCircle( xc1, yc1,                   //  1- 
                          radius1,                    // 1-  
                          xc2, yc2,                   //  2- 
                          radius2 : Double;           // 2-  
                          tang    : TAN4 ) : Integer; //  
                          stdcall;

//   - 72 kAPI2D5.dll
//-----------------------------------------------------------------------------
//     .
//         
// .  4  CON,   .
//-----------------------------------------------------------------------------
procedure CouplingLineLine( x1, y1,           //   
                            angle1,           //  
                            x2, y2,           //   
                            angle2,           //  
                            rad    : Double;  //  
                            Var kp : Integer; //  
                            con    : CON4 );  // 
                            stdcall;

//   - 167 kAPI2D5.dll
//-----------------------------------------------------------------------------
//         
// .   8  CON   
//-----------------------------------------------------------------------------
procedure ksCouplingLineCircle( xc, yc,           // 
                                radc,             // 
                                x1, y1,           //   
                                angle1,           // 
                                rad    : Double;  //  
                                Var kp : Integer; //  
                                con    : CON8 );  // 
                                stdcall;

//   - 168 kAPI2D5.dll
//-----------------------------------------------------------------------------
//         
//     
//   8  CON   
//-----------------------------------------------------------------------------
procedure ksCouplingCircleCircle( xc1, yc1,          //   
                                  radc1,             //  
                                  xc2, yc2,          //   
                                  radc2,             //  
                                  rad    : Double;   //  
                                  Var kp : Integer;  //  
                                  con    : CON8 );   // 
                                  stdcall;

//   - 73 kAPI2D5.dll
//-----------------------------------------------------------------------------
//     .
//-----------------------------------------------------------------------------
procedure Symmetry( x , y,                 // 
                    x1, y1,                //   
                    x2, y2     : Double;   //  
                    Var xc, yc : Double ); //
                    stdcall;

//   - 74 kAPI2D5.dll
//-----------------------------------------------------------------------------
//     .
//-----------------------------------------------------------------------------
procedure Rotate( x, y,                   // 
                  xc, yc,                 // 
                  ang : Double;           // 
                  Var xr, yr : Double );  //
                  stdcall;

//   - 75 kAPI2D5.dll
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
function DistancePntPnt ( x1, y1,                     //  
                          x2, y2 : Double ) : double; //  
                          stdcall;

//   - 207 kAPI2D5.dll
//-----------------------------------------------------------------------------
//      
//-----------------------------------------------------------------------------
function ksDistancePntLineSeg ( x,  y,                      // 
                                x1, y1,                     //  
                                x2, y2 : Double ) : Double; //  
                                stdcall;

//   - 208 kAPI2D5.dll
//-----------------------------------------------------------------------------
//      
//-----------------------------------------------------------------------------
function ksDistancePntArc ( x, y,                           // 
                            xac, yac,                       // 
                            rada,                           // 
                            fa1, fa2 : Double;              //    
                            directa  : SmallInt ) : Double; // 
                            stdcall;

//   - 209 kAPI2D5.dll
//-----------------------------------------------------------------------------
//      
//-----------------------------------------------------------------------------
function ksDistancePntCircle ( x,  y,                     // 
                               xc, yc,                    // 
                               rad : Double ) : Double;   // 
                               stdcall;


//   - 210 kAPI2D5.dll
//-----------------------------------------------------------------------------
//      ,    
//-----------------------------------------------------------------------------
function ksDistancePntLine (  x,  y,                     // 
                              x1, y1,                    //   
                              angle : Double ) : Double; // 
                              stdcall;

//   - 212 kAPI2D5.dll
//-----------------------------------------------------------------------------
//      ,  
//-----------------------------------------------------------------------------
function ksDistancePntLineForPoint ( x,   y,                       // 
                                     x1,  y1,                      //   
                                     x2,  y2 : Double) : Double;   //   
                                     stdcall;



//         
//  .
//-----------------------------------------------------------------------------
procedure Perpendicular ( x , y,                 //  
                          x1, y1,                //  
                          x2, y2     : Double;   //  
                          Var xp, yp : Double ); //  
                          stdcall;

//   - 164 kAPI2D5.dll
//---------------------------------------------------------------------------
//       
//---------------------------------------------------------------------------
procedure MovePoint ( Var x, y : Double;     // 
                      ang, len : Double );   //   .   
                      stdcall;

//   - 224    kAPI2D5.dll
//-----------------------------------------------------------------------------
//          ( 0 - 360  ).
//      ,     .
//     -1
//-----------------------------------------------------------------------------
function ksGetCurvePerpendicular( curve : Reference;        //  
                                  x,  y : Double ) : Double; // 
                                  stdcall;


//   - 223    kAPI2D5.dll
//-----------------------------------------------------------------------------
//        .
//     0
//-----------------------------------------------------------------------------
function ksPointsOnCurve( curve : Reference;             //  
                          count : Integer ) : Reference; // 
                          stdcall;

//   - 258    kAPI2D5.dll
//-----------------------------------------------------------------------------
//       .
//     0.
//-----------------------------------------------------------------------------
function ksGetCurvePointProjection( curve      : Reference;           //   
  		                      		    x, y       : Double;              //  
				                            Var kx, ky : Double ) : Integer;  //   
                                    stdcall;


//   - 258    kAPI2D5.dll
//-----------------------------------------------------------------------------
//       .
//     0.
//-----------------------------------------------------------------------------
function ksGetCurvePointProjectionEx( curve    : Reference;           //   
  		                      		    x, y       : Double;              //  
				                            Var kx, ky : Double;              //   
                                    Var t      : Double ) : Integer;  //  
                                    stdcall;

//   - 258    kAPI2D5.dll
//-----------------------------------------------------------------------------
//     t   .
//     0.
//-----------------------------------------------------------------------------
function ksGetCurvePoint( curve  : Reference;                         //   
  		                      		    t       : Double;                 //  
				                            Var kx, ky : Double ) : Integer;  //   
                                    stdcall;

//   - 225    kAPI2D5.dll
//-----------------------------------------------------------------------------
//      len  .
//      ,     .
//   1     0  .
//-----------------------------------------------------------------------------
function ksMovePointOnCurve( curve    : Reference;           //   
                             Var x, y : Double;              //  
                             len      : Double;              //      
                             dir      : Integer ) : Integer; //   (1 -    , -1    )
                             stdcall;

//   - 228    kAPI2D5.dll
//-----------------------------------------------------------------------------
//   
//-----------------------------------------------------------------------------
function ksGetCurvePerimeter( curve     : Reference;       //   
                              dimension : Byte ) : Double; //     [ST_MIX_SM..ST_MIX__M]
                              stdcall;

//   - 746
//-----------------------------------------------------------------------------
//       .
//     0.
//-----------------------------------------------------------------------------
function ksGetCurveMinMaxParametr( curve : Reference;          //   
             					  					 tMin  : PDouble;             //   
                                   tMax  : PDouble ) : Integer; //   
                                   stdcall;

//   - 747
//-----------------------------------------------------------------------------
//        
//      
//     0
//-----------------------------------------------------------------------------
function ksDistanceT1T2OnCurve( curve :reference;       //   
																				 t1 : Double;             //     1
                                         t2 : Double ) : Double;  //     2
                                         stdcall;
//   - 754
//-----------------------------------------------------------------------------
//       .
//   :
//   1  
//   0    (         )
//   -1    
//   -2    
//   -3     
//   -4      (  ) (?)
//   -5     
//   -6     
//   -7 
// ---
function ksTanCurvCurv( p1,                                //    
                        p2,                                //    
                        pointArr1,                         //     
                        pointArr2 : Reference ) : Integer; //     
                                                  stdcall;
//   - 229    kAPI2D5.dll
//-----------------------------------------------------------------------------
//   -      
//            
//    ,   1.
//-----------------------------------------------------------------------------
function ksCalcInertiaProperties( p          : Reference;        //     
                                  properties : PInertiaParam;    //   - 
                                  dimension  : Byte ) : Integer; //   [ST_MIX_SM..ST_MIX__M]
                                  stdcall;

//   - 230    kAPI2D5.dll
//-----------------------------------------------------------------------------
//   -      
//     
//            
// .
// bitVector -   ,  ,
//   (    ).     [ST_MIX_MM..ST_MIX_RV]
//   ( ||- ST_MIX_M|ST_MIX_KG|ST_MIX_RV )
//-----------------------------------------------------------------------------
function ksCalcMassInertiaProperties( p         : Reference;          //      
                                      properties: PMassInertiaParam;  //    - 
                                      bitVector : Cardinal;           //  
                                      density   : Double;             //   /3
                                      param     : Double ) : Integer; //   -   ,   - 
                                      stdcall;


//   - 38 kAPI2D5.dll
//--------------------------------------------------------------------------
//         
//--------------------------------------------------------------------------
function  ksPointIntoMtr( x, y   : Double;             // 
                          Var xn : Double;             //
                          Var yn : Double ) : Integer;
                          stdcall;

//   - 39 kAPI2D5.dll
//--------------------------------------------------------------------------
//         
//--------------------------------------------------------------------------
function  ksPointFromMtr( x, y   : Double;        // 
                          Var xn : Double;        //
                          Var yn : Double ) : Integer;
                          stdcall;

//   - 91 kAPI2D5.dll
//------------------------------------------------------------------------------
//        
//    0   , 1 -   , 2 -    3 -   
// ---
function ksIsPointInsideContour( p   :    reference;             //  
                                 x,y :    double;            // 
                                 precision : double ) : integer; //    1..1E-6
                                                        stdcall;

//   - 40 kAPI2D5.dll
//--------------------------------------------------------------------------
//      
//--------------------------------------------------------------------------
function ksLengthIntoMtr( Var len : Double ) : Integer; stdcall;

//   - 41 kAPI2D5.dll
//--------------------------------------------------------------------------
//       
//--------------------------------------------------------------------------
function  ksLengthFromMtr( Var len : Double ) : Integer; stdcall;
//-----------------------------------------------------------------------------
//          .
//     0
//-----------------------------------------------------------------------------
function ksPointsOnCurveByStep( curve : reference; //   
                                step : Double ) : reference;   //   
                                stdcall;

//-----------------------------------------------------------------------------
//        .
//      ,     .
//     0
//-----------------------------------------------------------------------------
function ksDistancePntPntOnCurve( curve : reference;      //   
	   			                        x1, y1,  //   
                                  x2, y2 : Double ) : Double;
                                  stdcall;

//   - 78    kAPI2D5.dll
//--------------------------------------------------------------------------
//  
// s = ;     :
// SIN,COS,TAN,ATAN,  -    (    )
// SQRT,EXP,LN,ABS,   - , ,  ,  
// SIND,COSD,TAND,ATAND -    (   )
//  s = "A1 = 100 " -    A1 c  100;
//     
//    1     0   
//--------------------------------------------------------------------------
function ksCalculate( s       : PChar;              //
                      Var rez : Double ) : Integer; //
                      stdcall;

//   - 78    kAPI2D5.dll
//--------------------------------------------------------------------------
//  
// s = ;     :
// SIN,COS,TAN,ATAN,  -    (    )
// SQRT,EXP,LN,ABS,   - , ,  ,  
// SIND,COSD,TAND,ATAND -    (   )
//  s = "A1 = 100 " -    A1 c  100;
//     
//    1     0   
//--------------------------------------------------------------------------
function ksCalculateW( s       : PWideChar;          // 
                       Var rez : Double ) : Integer; // 
                       stdcall;


//   - 79    kAPI2D5.dll
//--------------------------------------------------------------------------
//     
//    1     0   
//--------------------------------------------------------------------------
function ksCalculateReset : Integer; stdcall;

//--------------------------------------------------------------------------------
//       .
//   :
//   1  
//   0     
//   -1    
//   -2    
//   -3     
//   -4      (  ) (?)
//   -5     
//   -6     
//   -7 
//       array        .
//---------------------------------------------------------------------------------
function  ksIntersectCurvCurv ( p1 : Reference;      //    
                                p2 : Reference;      //    
                                pArr : Reference ) : Integer;  stdcall; //     MathPointParam

//-----------------------------------------------------------------------------
//        
//      0   
//     pArray        .
//-----------------------------------------------------------------------------
function  ksTanLinePointCurve( x, y : Double;     // 
 	   									         pCur,              // 
                               pArr : Reference ) : Integer;  stdcall;      //     MathPointParam

////////////////////////////////////////////////////////////////////////////////
//
//   . LT_Attr.h
//
////////////////////////////////////////////////////////////////////////////////

//   - 174 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname
//  libname = NULL-     
//       0  
//-------------------------------------------------------------------------
function ksCreateAttrType( attrType : PksAttributeType; //    
                           libname  : PChar ) : Double; //    
                           stdcall;

//   - 886 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname
//  libname = NULL-     
//       0  
//-------------------------------------------------------------------------
function ksCreateAttrTypeW( attrType : PksAttributeTypeW;    //    
                            libname  : PWideChar ) : Double; //    
                            stdcall;

//   - 106 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname.
//  libname = NULL,     .
//-------------------------------------------------------------------------
function DeleteAttrType( attrID   : Double;               //   
                         libname  : PChar;                //    
                         password : PChar   ) : Integer;  //    
                         stdcall;


//   - 887 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname.
//  libname = NULL,     .
//-------------------------------------------------------------------------
function DeleteAttrTypeW( attrID   : Double;                //   
                          libname  : PWideChar;             //    
                          password : PWideChar ) : Integer; //    
                          stdcall;


//   - 175 kAPI2D5.dll
//-------------------------------------------------------------------------
//       libname.
//  libname = NULL,     .
//   ksAttributeType.
//-------------------------------------------------------------------------
function ksGetAttrType( attrID   : Double;                        //   
                        libname  : PChar;                         //    
                        attrType : PksAttributeType ) : Integer;  //    
                        stdcall;

//   - 888 kAPI2D5.dll
//-------------------------------------------------------------------------
//       libname.
//  libname = NULL,     .
//   ksAttributeType.
//-------------------------------------------------------------------------
function ksGetAttrTypeW( attrID   : Double;                        //   
                         libname  : PWideChar;                     //    
                         attrType : PksAttributeTypeW ) : Integer;  //    
                         stdcall;


//   - 176 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname.
//  libname = NULL,     .
//       0  .
//-------------------------------------------------------------------------
function ksSetAttrType(  attrID   : Double;           //   
                         libname  : PChar;            //    
                         attrType : PksAttributeType; //    
                         password : PChar ) : Double; //   
                         stdcall;


//   - 176 kAPI2D5.dll
//-------------------------------------------------------------------------
//      libname.
//  libname = NULL,     .
//       0  .
//-------------------------------------------------------------------------
function ksSetAttrTypeW(  attrID   : Double;               //   
                          libname  : PWideChar;            //    
                          attrType : PksAttributeTypeW;    //    
                          password : PWideChar ) : Double; //   
                          stdcall;


//   - 109 kAPI2D5.dll
//-------------------------------------------------------------------------
//            libname.
//   libname = NULL,     .
//         0  .
//       , , , .
//   pObj = 0 -  
//-------------------------------------------------------------------------
function CreateAttr( pObj    : Reference;           //      
                     attr    : PAttribute;          //   
                     attrID  : Double;              //   
                     libname : PChar ) : Reference; //    
                     stdcall;


//   - 258 kAPI2D5.dll
//-------------------------------------------------------------------------
//            libname.
//   libname = NULL,     .
//         0  .
//       , , , .
//   pObj = 0 -  
//-------------------------------------------------------------------------
function ksCreateAttr( pObj    : Reference;           //      
                       attr    : PksAttribute;          //   
                       attrID  : Double;              //   
                       libname : PChar ) : Reference; //    
                       stdcall;


//   - 258 kAPI2D5.dll
//-------------------------------------------------------------------------
//            libname.
//   libname = NULL,     .
//         0  .
//       , , , .
//   pObj = 0 -  
//-------------------------------------------------------------------------
function ksCreateAttrW( pObj    : Reference;               //      
                        attr    : PksAttributeW;           //   
                        attrID  : Double;                  //   
                        libname : PWideChar ) : Reference; //    
                        stdcall;


//   - 110 kAPI2D5.dll
//-------------------------------------------------------------------------
//   .   1     0  .
//   pObj = 0 -  
//-------------------------------------------------------------------------
function DeleteAttr ( pObj     : Reference;         //       
                      pAttr    : Reference;         //    
                      password : PChar ) : Integer; //   
                      stdcall;


//   - 894 kAPI2D5.dll
//-------------------------------------------------------------------------
//   .   1     0  .
//   pObj = 0 -  
//-------------------------------------------------------------------------
function DeleteAttrW( pObj     : Reference;             //       
                      pAttr    : Reference;             //    
                      password : PWideChar ) : Integer; //   
                      stdcall;


//   - 111 kAPI2D5.dll
//-------------------------------------------------------------------------
//      .
//   1     0  .
//-------------------------------------------------------------------------
function GetAttrValue ( pAttr       : Reference;         //  
                        rowNumb     : Cardinal;              //  
                        columnNumb  : Cardinal;              //  
                        flagVisible : PByte;             //     ( ,      ,  )
                        value       : Pointer;           //    ,    
                        size        : Cardinal ) : Integer;  //   
                        stdcall;


//   - 251 kAPI2D5.dll
//-------------------------------------------------------------------------
//      .
//   1     0  .
//       char
//-------------------------------------------------------------------------
function ksGetAttrValue ( pAttr       : Reference;            //  
                          rowNumb     : Word;                 //  
                          columnNumb  : Word;                 //  
                          flagVisible : PByte;                //     ( ,      ,  )
                          columnKeys  : PByte;                //     ( ,      ,  )
                          value       : Pointer;              //    ,    
                          size        : Cardinal ) : Integer; //   
                          stdcall;


//   - 251 kAPI2D5.dll
//-------------------------------------------------------------------------
//      .
//   1     0  .
//       wchar_t (Unicode)
//-------------------------------------------------------------------------
function ksGetAttrValueW( pAttr       : Reference;            //  
                          rowNumb     : Word;                 //  
                          columnNumb  : Word;                 //  
                          flagVisible : PByte;                //     ( ,      ,  )
                          columnKeys  : PByte;                //     ( ,      ,  )
                          value       : Pointer;              //    ,    
                          size        : Cardinal ) : Integer; //   
                          stdcall;


//   - 112 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function SetAttrValue ( pAttr       : Reference;         //  
                        rowNumb     : Word;              //  
                        columnNumb  : Word;              //  
                        flagVisible : PByte;             //     ( ,      ,  )
                        value       : Pointer;           //    ,    
                        size        : Cardinal;          //   
                        password    : PChar ) : Integer; //  
                        stdcall;


//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function ksSetAttrValue ( pAttr     : Reference;         //  
                        rowNumb     : Word;              //  
                        columnNumb  : Word;              //  
                        flagVisible : PByte;             //     ( ,      ,  )
                        columnKeys  : PByte;                //      
                        value       : Pointer;           //    ,    
                        size        : Cardinal;          //   
                        password    : PChar ) : Integer; //  
                        stdcall;


//-------------------------------------------------------------------------
//       .
//    1     0  .  (Unicode)
//-------------------------------------------------------------------------
function ksSetAttrValueW( pAttr       : Reference;             //  
                          rowNumb     : Word;                  //  
                          columnNumb  : Word;                  //  
                          flagVisible : PByte;                 //     ( ,      ,  )
                          columnKeys  : PByte;                 //      
                          value       : Pointer;               //    ,    
                          size        : Cardinal;              //   
                          password    : PWideChar ) : Integer; //  
                          stdcall;


//   - 113 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function GetAttrRow ( pAttr       : Reference;            //  
                      rowNumb     : Word;                 //  
                      flagVisible : PByte;                //     ( ,      ,  )
                      value       : Pointer;              //    ,    
                      size        : Cardinal ) : Integer; //   
                      stdcall;

//   - 253 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function ksGetAttrRow ( pAttr       : Reference;            //  
                      rowNumb     : Word;                 //  
                      flagVisible : PByte;                //     ( ,      ,  )
                      columnKeys  : PByte;                //      
                      value       : Pointer;              //    ,    
                      size        : Cardinal ) : Integer; //   
                      stdcall;


//   - 948 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function ksGetAttrRowW( pAttr       : Reference;            //  
                        rowNumb     : Word;                 //  
                        flagVisible : PByte;                //     ( ,      ,  )
                        columnKeys  : PByte;                //      
                        value       : Pointer;              //    ,    
                        size        : Cardinal ) : Integer; //   
                        stdcall;


//   - 114 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function SetAttrRow ( pAttr       : Reference;         //  
                      rowNumb     : Word;              //  
                      flagVisible : PByte;             //     ( ,      ,  )
                      value       : Pointer;           //    ,    
                      size        : Cardinal;          //   
                      password    : PChar ) : Integer; //  
                      stdcall;

//   - 254 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function ksSetAttrRow ( pAttr       : Reference;       //  
                      rowNumb     : Word;              //  
                      flagVisible : PByte;             //     ( ,      ,  )
                      columnKeys  : PByte;             //      
                      value       : Pointer;           //    ,    
                      size        : Cardinal;          //   
                      password    : PChar ) : Integer; //  
                      stdcall;


//   - 898 kAPI2D5.dll
//-------------------------------------------------------------------------
//       .
//    1     0  .
//-------------------------------------------------------------------------
function ksSetAttrRowW( pAttr       : Reference;             //  
                        rowNumb     : Word;                  //  
                        flagVisible : PByte;                 //     ( ,      ,  )
                        columnKeys  : PByte;                 //      
                        value       : Pointer;               //    ,    
                        size        : Cardinal;              //   
                        password    : PWideChar ) : Integer; //  
                        stdcall;


//   - 218 kAPI2D5.dll
//-------------------------------------------------------------------------
//        
//    1     0  
//-------------------------------------------------------------------------
function ksAddAttrRow ( pAttr       : Reference;         //  
                        rowNumb     : Integer;           //  ,   , -1 - 
                        flagVisible : PByte;             //       
                        value       : Pointer;           //    ,   
                        size        : Cardinal;          //     value
                        password    : PChar ) : Integer; //  
                        stdcall;


//   - 899 kAPI2D5.dll
//-------------------------------------------------------------------------
//        
//    1     0   (Unicode)
//-------------------------------------------------------------------------
function ksAddAttrRowW( pAttr       : Reference;         //  
                        rowNumb     : Integer;           //  ,   , -1 - 
                        flagVisible : PByte;             //       
                        value       : Pointer;           //    ,   
                        size        : Cardinal;          //     value
                        password    : PWideChar ) : Integer; //  
                        stdcall;


//   - 219 kAPI2D5.dll
//-------------------------------------------------------------------------
//       
//    1     0  
//-------------------------------------------------------------------------
function ksDeleteAttrRow ( pAttr    : Reference;         //  
                           rowNumb  : Cardinal;          //  
                           password : PChar ) : Integer; //  
                           stdcall;


//   - 900 kAPI2D5.dll
//-------------------------------------------------------------------------
//       
//    1     0  
//-------------------------------------------------------------------------
function ksDeleteAttrRowW( pAttr    : Reference;             //  
                           rowNumb  : Cardinal;              //  
                           password : PWideChar ) : Integer; //  
                           stdcall;


//   - 177 kAPI2D5.dll
//-------------------------------------------------------------------------
//   ;  GetSizeAttrValue
//     
//-------------------------------------------------------------------------
function ksGetSizeAttrValue ( pAttr      : Reference;           //  
                              columnNumb : Cardinal;            //  
                              Var count  : Integer ) : Integer; //   (  )
                              stdcall;


//   - 177 kAPI2D5.dll
//-------------------------------------------------------------------------
//      ( Unicode )
//-------------------------------------------------------------------------
function ksGetSizeAttrValueW( pAttr      : Reference;           //  
                              columnNumb : Cardinal;            //  
                              Var count  : Integer ) : Integer; //   (  )
                              stdcall;


//   - 178 kAPI2D5.dll
//-------------------------------------------------------------------------
//      GetSizeAttrRow
//      
//-------------------------------------------------------------------------
function ksGetSizeAttrRow (  pAttr     : Reference;            //  
                             Var count : Integer  ) : Integer; //   (  )
                             stdcall;


//   - 178 kAPI2D5.dll
//-------------------------------------------------------------------------
//       ( Unicode )
//-------------------------------------------------------------------------
function ksGetSizeAttrRowW(  pAttr     : Reference;            //  
                             Var count : Integer  ) : Integer; //   (  )
                             stdcall;


//   - 117 kAPI2D5.dll
//-------------------------------------------------------------------------
//      .
//    NULL,    .
//-------------------------------------------------------------------------
function GetAttrKeysInfo( pAttr    : Reference;          //  
                          Var key1 : Cardinal;           //
                          Var key2 : Cardinal;           //     
                          Var key3 : Cardinal;           //
                          Var key4 : Cardinal;           //
                          Var numb : Double ) : Integer; //       
                          stdcall;

//   - 118 kAPI2D5.dll
//-------------------------------------------------------------------------
//     .
//   1     0  .
//-------------------------------------------------------------------------
function GetAttrColumnInfo ( pAttr      : Reference;               //  
                             columnNumb : Cardinal;                //  
                             columnInfo : PColumnInfo ) : Integer; //      
                             stdcall;


//   - 901 kAPI2D5.dll
//-------------------------------------------------------------------------
//     .
//   1     0  .
//-------------------------------------------------------------------------
function GetAttrColumnInfoW( pAttr      : Reference;                //  
                             columnNumb : Cardinal;                 //  
                             columnInfo : PColumnInfoW ) : Integer; //      
                             stdcall;


//   - 119 kAPI2D5.dll
//-------------------------------------------------------------------------
//        .
//   1     0  .
//-------------------------------------------------------------------------
function GetAttrTabInfo ( pAttr            : Reference;            //  
                          var rowsCount    : Cardinal;             //  
                          var columnsCount : Cardinal ) : Integer; //   
                          stdcall;

//   - 120 kAPI2D5.dll
//-------------------------------------------------------------------------
//        .
//    1     0  .
//      .
//-------------------------------------------------------------------------
function ViewEditAttr (  pAttr    : Reference;         //  
                         _type    : Cardinal;          // 1-  2- 
                         password : PChar ) : Integer; //      0
                         stdcall;


//   - 902 kAPI2D5.dll
//-------------------------------------------------------------------------
//        .
//    1     0  .
//      .
//-------------------------------------------------------------------------
function ViewEditAttrW( pAttr    : Reference;             //  
                        _type    : Cardinal;              // 1-  2- 
                        password : PWideChar ) : Integer; //      0
                        stdcall;


//   - 121 kAPI2D5.dll
//-------------------------------------------------------------------------
//         .
//    1     0  .
//      .
//-------------------------------------------------------------------------
function ViewEditAttrType ( libname : PChar;              //    
                            _type   : Cardinal;           // 1-  2- 
                            attrId  : Double;             //   
                            password: PChar ) : Integer;  //     0
                            stdcall;


//   - 121 kAPI2D5.dll
//-------------------------------------------------------------------------
//         .
//    1     0  .
//      .
//-------------------------------------------------------------------------
function ViewEditAttrTypeW( libname : PWideChar;             //    
                            _type   : Cardinal;              // 1-  2- 
                            attrId  : Double;                //   
                            password: PWideChar ) : Integer; //     0
                            stdcall;


//   - 122 kAPI2D5.dll
//-------------------------------------------------------------------------
//          
//     .
//  libname = NULL,     .
//       0  .
//     .
//-------------------------------------------------------------------------
function ChoiceAttrTypes ( libname : PChar  ) : Double;  //    
                           stdcall;


//   - 904 kAPI2D5.dll
//-------------------------------------------------------------------------
//          
//     .
//  libname = NULL,     .
//       0  .
//     .
//-------------------------------------------------------------------------
function ChoiceAttrTypesW( libname : PWideChar ) : Double;  //    
                           stdcall;


//   - 123 kAPI2D5.dll
//-------------------------------------------------------------------------
//           .
//            0  .
//-------------------------------------------------------------------------
function ChoiceAttr ( pObj : Reference ) : Reference; //      
                      stdcall;

//   - 123 kAPI2D5.dll
//-------------------------------------------------------------------------------------
//       LIBRARY_ATTR_TYPE_ARR -
//   ,     .
//     0.
//-------------------------------------------------------------------------------------
function ksGetLibraryAttrTypesArray( libname : PChar ): Reference;    //     
                                     stdcall;


//   - 123 kAPI2D5.dll
//-------------------------------------------------------------------------------------
//       LIBRARY_ATTR_TYPE_ARR -
//   ,     .
//     0.
//-------------------------------------------------------------------------------------
function ksGetLibraryAttrTypesArrayW( libname : PWideChar ): Reference; //     
                                      stdcall;


////////////////////////////////////////////////////////////////////////////////
//
//    LT_Spc.h
//
////////////////////////////////////////////////////////////////////////////////

//   - 44    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//      
//  
//    SpcObjEnd();
//  ,         numb,   
//      
// nameLib  styleNumb -        ,
//    
//------------------------------------------------------------------------------------------------
function ksSpcObjectCreate( nameLib             : PChar;            //  
                            styleNumb           : Cardinal;         //  
                            secNumb, subSecNumb : Word;             //   
                            numb                : Double;           //  -  ,      0
                                                                    //   -   ,      0
                            typeObj             : Byte ) : Integer; //  0-   1- 
                            stdcall;


//   - 807    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//      
//  
//    SpcObjEnd();
//  ,         numb,   
//      
// nameLib  styleNumb -        ,
//    
//------------------------------------------------------------------------------------------------
function ksSpcObjectCreateW( nameLib             : PWideChar;        //   
                             styleNumb           : Cardinal;         //   
                             secNumb, subSecNumb : Word;             //    
                             numb                : Double;           //   -  ,      0
                                                                     //    -   ,      0
                             typeObj             : Byte ) : Integer; //   0-   1- 
                             stdcall;


//   - 50    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//     
//      , ,  , ,  .
//       ksSpcObjectEnd()
//------------------------------------------------------------------------------------------------
function ksSpcObjectEdit( spcObj : Reference  ) : Integer; stdcall;

//   - 45    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//   
//      .
//   ,      
//  .
//     
//------------------------------------------------------------------------------------------------
function ksSpcObjectEnd : Reference;
                          stdcall;

//   - 46    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//       itemNumb      colNumb
//           itemNumb      1
// typeVal -     CHAR_ATTR_TYPE ...STRING_ATTR_TYPE . ltdefine.h
//  typeVal== STRING_ATTR_TYPE,  val -   char[MAX_TEXT_LENGTH]
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcChangeValue(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcChangeValue( colNumb : Cardinal;         // ,   
                           itemNum : Cardinal;        // ,   
                           val     : Pointer;          //  
                           typeVal : Byte ) : Integer; // 
                           stdcall;


//   - 951   kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//       itemNumb      colNumb
//           itemNumb      1
// typeVal -     CHAR_ATTR_TYPE ...STRING_ATTR_TYPE . ltdefine.h
//  typeVal== STRING_ATTR_TYPE,  val -   wchar_t[MAX_TEXT_LENGTH]
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcChangeValue(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcChangeValueW( colNumb : Cardinal;         // ,   
                            itemNum : Cardinal;        // ,   
                            val     : Pointer;          //  
                            typeVal : Byte ) : Integer; // 
                            stdcall;

//   - 47    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//       itemNumb      colNumb
//           itemNumb      1
// typeVal -     CHAR_ATTR_TYPE ...STRING_ATTR_TYPE . ltdefine.h
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcVisible(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcVisible( colNumb  : Cardinal;         // ,   
                       itemNumb : Cardinal;         // ,   
                       flagOn   : Byte ) : Integer; //1 -  0- 
                       stdcall;

//   - 48    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//    .      1,     
//    "".     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcMassa(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcMassa ( sMassa : PChar ) : Integer;        // 
                      stdcall;

//   - 808    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//    .      1,     
//    "".     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcMassa(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcMassaW( sMassa : PWideChar ) : Integer;        // 
                      stdcall;


//   - 63    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//      .     1,     
//    "".     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcCount(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcCount ( ispoln : Byte;              // 
                      sCount : PChar ) : Integer; // 
                      stdcall;


//   - 809   kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//      .     1,     
//    "".     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcCount(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcCountW( ispoln : Byte;                  //  
                      sCount : PWideChar ) : Integer; //  
                      stdcall;


//   - 49    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//     .     1,     
//    "".     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcPosition(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//------------------------------------------------------------------------------------------------
function ksSpcPosition( pos : Word ) : Integer; stdcall;

//   - 51    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//           
//       .     1,   
//     .     0.
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSpcIncludeReference(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//  obj == 0  clear == 0       
//------------------------------------------------------------------------------------------------
function ksSpcIncludeReference( obj   : Reference;        //    
                                clear : Byte ) : Integer; // 2 -    
                                stdcall;                  // 1 -   
                                                          // 0 -   
                                                          
//   - 52    kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//           
//  obj = 0 -   
//   equal = 1
//    
//------------------------------------------------------------------------------------------------
function ksGetSpcObjForGeom( nameLib : PChar;               //   
                             numb    : Cardinal;            //  
                             obj     : Reference;           //    -  
                             equal   : Byte;                // 1 -      ; 0-    
                             first   : Byte ) : Reference;  // 1 -  0-  
                             stdcall;

//   - 65  kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//               
//  obj = 0 -   
//    
//------------------------------------------------------------------------------------------------
function ksGetSpcObjForGeomWithLimit( nameLib      : PChar;                //   
                                      numb         : Cardinal;             //  
                                      obj          : Reference;            //    -  
                                      equal        : Byte;                 // 1 -      ; 0-    
                                      first        : Byte;                 // 1 -  0-  
                                      section      : Word;                 //  ,    ,  0 -  
                                      attrTypeNumb : Double ) : Reference; //       ,  0 -  
                                      stdcall;


//   - 811  kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//               
//  obj = 0 -   
//    
//------------------------------------------------------------------------------------------------
function ksGetSpcObjForGeomWithLimitW( nameLib      : PWideChar;            //    
                                       numb         : Cardinal;             //   
                                       obj          : Reference;            //    -  
                                       equal        : Byte;                 // 1 -      ; 0-    
                                       first        : Byte;                 // 1 -  0-  
                                       section      : Word;                 //  ,    ,  0 -  
                                       attrTypeNumb : Double ) : Reference; //       ,  0 -  
                                       stdcall;


//   - 108    kAPI2D5.dll
//------------------------------------------------------------------------------
//        
//  true    
// ---
function  ksGetSpcSectionName( spcObj : Reference;           //   
                               name   : PChar;               //    
                               size   : Integer ) : Integer; //  
                               stdcall;


//   - 108    kAPI2D5.dll
//------------------------------------------------------------------------------
//        
//  true    
// ---
function  ksGetSpcSectionNameW( spcObj : Reference;           //   
                                name   : PWideChar;           //    
                                size   : Integer ) : Integer; //  
                                stdcall;


//   - 56    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//   .
//       ,    .
//   .         , 
//      Cursor, Placement, CommandWindow, ksEditViewObject, ksCreateViewObject;
//-------------------------------------------------------------------------------------------------
function ksEditWindowSpcObject( obj : Reference ): Integer; stdcall;

//   - 64    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//     
//-------------------------------------------------------------------------------------------------
function ksGetSpcObjectNumber( spcObj : Reference ) : Double; stdcall;

//   - 220    kAPI2D5.dll
//----------------------------------------------------------------------
//       
//       
//    
// nameLib  styleNumb -        ,
//    
//----------------------------------------------------------------------
function CreateSpcIterator( nameLib    : PChar;                   //   
                            styleNumb  : Cardinal;                //  
                            spcObjType : Integer ) : Reference; // 0 -   1 -   2-    
                            stdcall;


//   - 220    kAPI2D5.dll
//----------------------------------------------------------------------
//       
//       
//    
// nameLib  styleNumb -        ,
//    
//----------------------------------------------------------------------
function CreateSpcIteratorW( nameLib    : PWideChar;             //   
                             styleNumb  : Cardinal;              //  
                             spcObjType : Integer ) : Reference; // 0 -   1 -   2-    
                             stdcall;


//   - 67    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//     
//-------------------------------------------------------------------------------------------------
function ksGetSpcObject( objNumb : Double ) : Reference; stdcall;


//   - 68    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//         
//   block = 0 -        
// (    2.113-75    10 )
//   0      ,    size_s
//   , -1   
//-------------------------------------------------------------------------------------------------
function ksGetSpcObjectColumnText( spcObj     : Reference;            // 
                                   columnType : Cardinal;             //  SPC_CLM_FORMAT...SPC_CLM_USER
                                   ispoln     : Cardinal;             //  
                                   block      : Cardinal;             // 
                                   s          : PChar;                //
                                   size_s     : Cardinal ) : Integer; //  s
                                   stdcall;


//   - 68    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//         
//   block = 0 -        
// (    2.113-75    10 )
//   0      ,    size_s
//   , -1   
//-------------------------------------------------------------------------------------------------
function ksGetSpcObjectColumnTextW( spcObj     : Reference;            //  
                                    columnType : Cardinal;             //   SPC_CLM_FORMAT...SPC_CLM_USER
                                    ispoln     : Cardinal;             //   
                                    block      : Cardinal;             //  
                                    s          : PWideChar;            // 
                                    size_s     : Cardinal ) : Integer; //   s
                                    stdcall;


//   - 69    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//        
//   block = 0 -        
// (    2.113-75    10 )
//   1     0   
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSetSpcObjectColumnText(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//-------------------------------------------------------------------------------------------------
function ksSetSpcObjectColumnText( columnType : Cardinal;          //  SPC_CLM_FORMAT...SPC_CLM_USER
                                   ispoln     : Cardinal;          //  
                                   block      : Cardinal;          // 
                                   s          : PChar ) : Integer; //
                                   stdcall;


//   - 69    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//        
//   block = 0 -        
// (    2.113-75    10 )
//   1     0   
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSetSpcObjectColumnText(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//-------------------------------------------------------------------------------------------------
function ksSetSpcObjectColumnTextW( columnType : Cardinal;          //  SPC_CLM_FORMAT...SPC_CLM_USER
                                    ispoln     : Cardinal;          //  
                                    block      : Cardinal;          // 
                                    s          : PWideChar ) : Integer; //
                                    stdcall;


//   - 723
//-------------------------------------------------------------------------------------------------
//             
//    TEXT_LINE_ARR
//   block = 0 -        
// (    2.113-75    10 )
//          
// 0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcObjectColumnTextEx ( spcObj : reference;        // 
                                      columnType : Cardinal;     //  SPC_CLM_FORMAT...SPC_CLM_USER
                                      ispoln     : Cardinal;     //      1
                                      block      : Cardinal ) :  // 
                                      reference; stdcall;
//   - 724
//-------------------------------------------------------------------------------------------------
//        
//   block = 0 -        
// (    2.113-75    10 )
//   1     0   
//           
// ksSpcObjectCreate(...);  ksSpcObjectEdit(...);
//   .....
//   ksSetSpcObjectColumnTextEx(...);
//   .....
// reference spsObj = ksSpcObjectEnd();
//-------------------------------------------------------------------------------------------------
function ksSetSpcObjectColumnTextEx( columnType : Cardinal;     //  SPC_CLM_FORMAT...SPC_CLM_USER
                                     ispoln     : Cardinal;     //     1
                                     block      : Cardinal;     // 
                                     p          : reference ) : //    
                                     Integer; stdcall;

//   - 757
//-----------------------------------------------------------------------------------
// [6.06.05]
//       
// align :
// 0 -  
// 1 -   
// 2 -  
// 3 -   
// ---
function ksSetSpcObjectColumnTextAlign( spcObj : reference;                     //  
                                        columnNumber,                           //  ,   1
                                        lineIndex,                              //  
                                        align : Integer )                       // 
                                        : Integer; stdcall;

//   - 766
//-----------------------------------------------------------------------------------
// [16/07/05]
//       
// 0 -  
// 1 -   
// 2 -   
// 3 -   
// ---
function ksGetSpcObjectColumnTextAlign( spcObj : reference;     // 
                                        columnNumber,           // ,   1
                                        lineIndex : Integer )   //  
                                        : Integer; stdcall;

//   - 75    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//         
//   , nameLib  numb  .
//         ,
//        .
//         0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcTableColumn( nameLib        : PChar;            //  
                              numb           : Cardinal;         //   
                              additioanalCol : Byte ) : Integer; // 0 -  (    ) 1-  
                              stdcall;


//   - 75    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//         
//   , nameLib  numb  .
//         ,
//        .
//         0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcTableColumnW( nameLib        : PWideChar;        //   
                               numb           : Cardinal;         //   
                               additioanalCol : Byte ) : Integer; // 0 -  (    ) 1-  
                               stdcall;


//   - 76    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//           (
//   SPC_CLM_FORMAT...SPC_CLM_USER,   ,  ,
//  (   ),   )
//         ,
//        ,
//    
//   1      0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcColumnType( spcObj : Reference;                   // 
                             colNumb: Cardinal;                    // ,   1
                             par    : PSpcColumnParam ) : Integer; // 
                             stdcall;


//   - 76    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//           (
//   SPC_CLM_FORMAT...SPC_CLM_USER,   ,  ,
//  (   ),   )
//         ,
//        ,
//    
//   1      0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcColumnTypeW( spcObj : Reference;                    //  
                              colNumb: Cardinal;                     //  ,   1
                              par    : PSpcColumnParamW ) : Integer; //  
                              stdcall;


//   - 77    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//    
//    SPC_CLM_FORMAT...SPC_CLM_USER,       
//   
//         0   
//-------------------------------------------------------------------------------------------------
function ksGetSpcColumnNumb( spcObj     : Reference;            // 
                             columnType : Cardinal;             //  SPC_CLM_FORMAT...SPC_CLM_USER
                             ispoln     : Cardinal;             //   
                             block      : Cardinal ) : Integer; // 
                             stdcall;

//   - 380    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//       (CHAR_STR_ARR),
//   
//-------------------------------------------------------------------------------------------------
function ksGetSpcSheetSB( spcDoc : Reference ) : Reference; // 
                          stdcall;


//   - 380    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//       (CHAR_STR_ARR_W),
//   
//-------------------------------------------------------------------------------------------------
function ksGetSpcSheetSB_W( spcDoc : Reference ) : Reference; // 
                            stdcall;


//   - 81    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//      ,   
//-------------------------------------------------------------------------------------------------
function ksSetSpcSheetSB( spcDoc : Reference;              // 
                          arr    : Reference ) : Integer;  //  CHAR_STR_ARR  CHAR_STR_ARR_W 
                          stdcall;

//   - 98    kAPI2D5.dll
//------------------------------------------------------------------------------
// C  
// onSheet - 1 -, 0- 
//   1     0 -   
// ---
function ksSpecificationOnSheet( onSheet : Byte ) : Integer; stdcall;



//   - 70    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//       
//  spcDoc = 0 -   
//-------------------------------------------------------------------------------------------------
function ksGetSpcDocumentPagesCount( spcDoc : Reference ) : Integer; stdcall;


//   - 113  kAPI2D5.dll
//------------------------------------------------------------------------------
//        numb   nameLib
//  nameLib = nil     
// tPar <=ALLPARAM          -   SpcStyleParam
// tPar == SPC_TUNING_PARAM -   SpcTuningStyleParam
// ---
function ksGetSpcStyleParam( nameLib : PChar;       //   
                             numb    : Cardinal;    //   
                             par     : Pointer;     //  
                             size    : Cardinal;    //   
                             tPar    : Integer ) : Integer; //   
                             stdcall;


//   - 818  kAPI2D5.dll
//------------------------------------------------------------------------------
//        numb   nameLib
//  nameLib = nil     
// tPar <=ALLPARAM          -   SpcStyleParam
// tPar == SPC_TUNING_PARAM -   SpcTuningStyleParam
// ---
function ksGetSpcStyleParamW( nameLib : PWideChar;   //   
                              numb    : Cardinal;    //   
                              par     : Pointer;     //  
                              size    : Cardinal;    //   
                              tPar    : Integer ) : Integer; //   
                              stdcall;


//   - 114  kAPI2D5.dll
//------------------------------------------------------------------------------
//       pDoc
// index = -1 -  , ( -  )
// state -   ( true - , false -  )
// ---
function ksGetSpcDescription( pDoc  : Reference;          //   
															index : Integer;	          //     
                              param : PSpcDescrParam;     //  
                              state : PChar ) : Integer;  // : true - , false - 
                              stdcall;


//   - 819  kAPI2D5.dll
//------------------------------------------------------------------------------
//       pDoc
// index = -1 -  , ( -  )
// state -   ( true - , false -  )
// ---
function ksGetSpcDescriptionW( pDoc  : Reference;          //   
														   index : Integer;	          //     
                               param : PSpcDescrParamW;     //  
                               state : PChar ) : Integer;  // : true - , false - 
                               stdcall;


//   - 116  kAPI2D5.dll
//------------------------------------------------------------------------------
//   pDoc       index
// /   ,  state = true
// index = -1 -  , ( -  )
//  param = NULL -   
// ---
function ksSetSpcDescription( pDoc  : Reference;    //   
                              index : Integer;	  //     
                              param : PSpcDescrParam;   //  
                              state : Byte ) : Integer; // : true - , false - 
                              stdcall;


//   - 821  kAPI2D5.dll
//------------------------------------------------------------------------------
//   pDoc       index
// /   ,  state = true
// index = -1 -  , ( -  )
//  param = NULL -   
// ---
function ksSetSpcDescriptionW( pDoc  : Reference;        //   
                               index : Integer;	         //     
                               param : PSpcDescrParamW;  //  
                               state : Byte ) : Integer; // : true - , false - 
                               stdcall;


//   - 117  kAPI2D5.dll
//------------------------------------------------------------------------------
//   pDoc   
// ---
function ksAddSpcDescription( pDoc  : Reference;     //   
                              param : PSpcDescrParam ) : Integer;  //  
                              stdcall;


//   - 117  kAPI2D5.dll
//------------------------------------------------------------------------------
//   pDoc   
// ---
function ksAddSpcDescriptionW( pDoc  : Reference;                    //   
                               param : PSpcDescrParamW ) : Integer;  //  
                               stdcall;


//------------------------------------------------------------------------------
//   pDoc       index
// ---
function ksDeleteSpcDescription( pDoc  : Reference;    //   
                                 index : Integer ) : Integer;  //     
                                 stdcall;

//   - 128  kAPI2D5.dll
//------------------------------------------------------------------------------
//        (       )
//      
// ---
function ksGetCurrentSpcObject : Reference; stdcall;

//   - 129  kAPI2D5.dll
//------------------------------------------------------------------------------------------------
//    
//    ,    
//      .
//   0     1   
//------------------------------------------------------------------------------------------------
function ksSetCurrentSpcObject( spcObj : Reference; index : Integer ) : Integer; stdcall;

//   - 89    kAPI2D5.dll
//-------------------------------------------------------------------------------------------------
//      
//-------------------------------------------------------------------------------------------------
function ksIsModuleSpecificationActive : Integer; stdcall;

//   - 135    kAPI2D5.dll
//------------------------------------------------------------------------------
//         
// attach: 1    ; 0 -    
//   1,        .
//     0
//
// ---
function ksModuleSpecification( attach : Byte ) : Integer; stdcall;

//------------------------------------------------------------------------------
//         
//   block = 0 -        
// (    2.113-75    10 )
//    ""     ,   
//     -    ,  .
//    - LTVARIANT_ARR
// ---
function  ksGetSpcObjectColumnValues( spcObj : Reference; //  
                                      columnType,         //   SPC_CLM_FORMAT...SPC_CLM_USER
                                      ispoln,             //       1
                                      block : Cardinal ) : Reference;  stdcall;    //  

//-----------------------------------------------------------------------------
//    slave    
//  doc =0 -   
//   0 -  , 1 - , 2-   
// [17.4.04]
// ---
function ksIsSlaveSpcOpened( doc : Reference ) : Integer; stdcall;

//------------------------------------------------------------------------------
//    width.
// numColumn  -  .
// cellOrText -       
//---
function  ksGetWidthColumnSpc( numColumn : Integer; cellOrText : Byte ) : Integer;  stdcall;

//   - 764
//-------------------------------------------------------------------------------
// [16/07/05]
//     
// ---
function ksGetSpcObjectAttributeNumber( spcObj : reference )    // 
                                               : Double; stdcall;

//   - 765
//-------------------------------------------------------------------------------
// [16/07/05]
//     
//  attrNumber == 0   
// ---
function ksSetSpcObjectAttributeNumber( spcObj : Reference;    //  
                                        attrNumber : Double ) //   
                                        : Integer; stdcall;

//   - 767
//-------------------------------------------------------------------------------
// [16/07/05]
//      
//    
// blockNumber = 0 -  
//               1        
//   
// blockNumber = 1
// ---
function ksGetSpcObjectSummaryCount( spcObj : Reference;     //  
                                     ispoln,                 //    "",   1(      )
                                     blockNumber : Integer ) //  ,   0 (     A )
                                     : Double; stdcall;

//-------------------------------------------------------------------------------
//           .
//      . 
//  c             . 
//   1   .   
// ---
function ksSetSpcObjectMaterial( spcObj : Reference; material : PChar; density : double ) : Integer; stdcall;


//-------------------------------------------------------------------------------
//           . Unicode
//      . 
//  c             .   
//   1   .  
// ---
function ksSetSpcObjectMaterialW( spcObj : Reference; material : PWideChar; density : double ) : Integer; stdcall;



//   - 284  kAPI2D5.dll
//--------------------------------------------------------------------------
//       .     
//  graphic.dsn.
//     /3     0   
// material -  
// sizeStr  -   material
// HWindow  - HWND 
//--------------------------------------------------------------------------
function ksViewGetDensityAndMaterial( material : PChar;
                                      sizeStr  : Integer;
                                      HWindow  : HWND ) : Double;
                                      stdcall;


//   - 852  kAPI2D5.dll
//--------------------------------------------------------------------------
//       .     
//  graphic.dsn.
//     /3     0   
// material -  
// sizeStr  -   material
// HWindow  - HWND 
//--------------------------------------------------------------------------
function ksViewGetDensityAndMaterialW( material : PWideChar;
                                       sizeStr  : Integer;
                                       HWindow  : HWND ) : Double;
                                       stdcall;


//-------------------------------------------------------------------------------
//    
// ---
function ksGetSpcPerformanceName( index,	                           //     
                                  ispoln,                            //    "",   1(      )
                                  blockNumber : Integer;             //  ,   0 (     A )
                                  name        : PChar;               //  
                                  nameLen     : Integer ) : Integer; //   
                                  stdcall;

//-------------------------------------------------------------------------------
//    
// ---
function ksGetSpcPerformanceNameW( index,	                            //     
                                   ispoln,                            //    "",   1(      )
                                   blockNumber : Integer;             //  ,   0 (     A )
                                   name        : PWideChar;           //  
                                   nameLen     : Integer ) : Integer; //   
                                   stdcall;

//-------------------------------------------------------------------------------
//    
// ---
function ksSetSpcPerformanceName( index,	                           //     
                                  ispoln,                            //    "",   1(      )
                                  blockNumber : Integer;             //  ,   0 (     A )
                                  name        : PChar) : Integer;    //  
                                  stdcall;

//-------------------------------------------------------------------------------
//    
// ---
function ksSetSpcPerformanceNameW( index,	                               //     
                                   ispoln,                               //    "",   1(      )
                                   blockNumber : Integer;                //  ,   0 (     A )
                                   name        : PWideChar ) : Integer; //  
                                   stdcall;

//   - 703
//------------------------------------------------------------------------------
//     
//  pDoc == 0,    
//  index == -1,     
//    :    
//    :  ,    
//     "  ".
//  3d  :  ,     .
// ---
function ksSetTuningSpcStyleParam( pDoc  : reference ;            //   
                                   index : Integer   ;            //     
                                   par   : PSpcTuningStyleParam ) //  
                                   : Integer; stdcall;


//   - 703
//------------------------------------------------------------------------------
//     
//  pDoc == 0,    
//  index == -1,     
//    :    
//    :  ,    
//     "  ".
//  3d  :  ,     .
// ---
function ksSetTuningSpcStyleParamW( pDoc  : reference ;             //   
                                    index : Integer   ;             //     
                                    par   : PSpcTuningStyleParamW ) //  
                                    : Integer; stdcall;


//   - 704
//------------------------------------------------------------------------------
//     
//  pDoc == 0,    
//  index == -1,     
//    :    
//    :  ,    
//     "  ".
//  3d  :  ,     .
// ---
function ksGetTuningSpcStyleParam( pDoc : reference;              //   
                                   index: Integer  ;              //     
                                   par  : PSpcTuningStyleParam )  //  
                                   : Integer; stdcall;


//   - 704
//------------------------------------------------------------------------------
//     
//  pDoc == 0,    
//  index == -1,     
//    :    
//    :  ,    
//     "  ".
//  3d  :  ,     .
// ---
function ksGetTuningSpcStyleParamW( pDoc : reference;               //   
                                    index: Integer  ;               //     
                                    par  : PSpcTuningStyleParamW )  //  
                                    : Integer; stdcall;


//   - 709
//------------------------------------------------------------------------------------------------
//       
//---
function ksGetSpcObjGeometry( spcObj : reference ) : reference; stdcall;

//   - 756
//-----------------------------------------------------------------------------
//  [31.03.2005]
//      ,    
//  geomMode  = 0 -   
//            = 1 -    
//            = 2 -     
// ---
function ksGetSpcObjGeometryEx( spcObj : reference; geomMode : Integer ) : reference; stdcall;

// [20.06.2005]
//   - 763
//-------------------------------------------------------------------------------------------------
//      
//  pDoc = 0 -   
//-------------------------------------------------------------------------------------------------
function ksGetDocumentPagesCount( pDoc : reference ) : Integer; stdcall;

//   - 957
//------------------------------------------------------------------------------
//       
// ---
function ksDrawKompasText( HWindow : HWND;                        //  
                           text    : PChar ): Integer;  stdcall;  // 

//   - 958
//------------------------------------------------------------------------------
//       
// ---
function ksDrawKompasTextW( HWindow : HWND;                           //  
                            text    : PWideChar  ): Integer; stdcall; // 


//-----------------------------------------------------------------------------
//    
// ---
procedure ksEnableThemeDialogTexture( HWindow : HWND ); stdcall;

//   - 996
// [22/05/2009]
//------------------------------------------------------------------------------
//   " "
// ---
function ksExecDialSpecialSymbol( HWindow : HWND ) : Integer; stdcall;

//   - 996
// [25/05/2009]
//------------------------------------------------------------------------------
//    " "
// ---
function ksExecDialSymbol( HWindow : HWND; symb : PInteger; font : PChar; len : Integer ) : Integer; stdcall;

//   - 996
// [25/05/2009]
//------------------------------------------------------------------------------
//    " "
// ---
function ksExecDialSymbolW( HWindow : HWND; symb : PInteger; font : PWideChar; len : Integer ) : Integer;   stdcall;

//   - 992
//------------------------------------------------------------------------------
//     (, 3D, )
//     
// ---
function ksSpcDocLinksClear( pDoc : Reference ) : Integer; stdcall;

//----------------------------------------------------------------------------------------------
//    .
//
//  fromDoc -   ,   
//  toDoc   -   ,   
//  gr      -    
//
//        to
//
//----------------------------------------------------------------------------------------------
function CopyGroupToDocument( gr, fromDoc, toDoc : Reference ) : Reference; stdcall;

//   - 1000
//------------------------------------------------------------------------------
//    "  "
// ---
function ksExecDialLineStyleSelect( HWindow : HWND; caption : PWideChar; style : Integer ) : Integer; stdcall;

implementation

function  ReturnResult; external APPTOOL5 Name 'ReturnResult';
function  ResultNULL; external APPTOOL5 Name 'ResultNULL';
procedure StrResult; external APPTOOL5 Name 'StrResult'
procedure MessageBoxResult; external APPTOOL5 Name 'MessageBoxResult';
function  GetHWindow; external APPTOOL5 Name 'GetHWindow';
function  ksGetWorkWindowColor; external APPTOOL5 Name 'ksGetWorkWindowColor';
procedure EnableTaskAccess; external APPTOOL5 Name 'EnableTaskAccess';
function  IsEnableTaskAccess; external APPTOOL5 Name 'IsEnableTaskAccess'
procedure PumpWaitingMessages; external APPTOOL5 Name 'PumpWaitingMessages';
function  ksChoiceFile; external APPTOOL5 Name 'ksChoiceFile';
function  ksChoiceFileAppointedDir; external APPTOOL5 Name 'ksChoiceFileAppointedDir';
function  ksChoiceFiles; external APPTOOL5 Name 'ksChoiceFiles';
function  ksSaveFile; external APPTOOL5 Name 'ksSaveFile';
function  ksInitFilePreviewFunc; external APPTOOL5 Name 'ksInitFilePreviewFunc';
procedure ksMessage; external APPTOOL5 Name 'Message';
procedure Error; external APPTOOL5 Name 'Error';
function  YesNo; external APPTOOL5 Name 'YesNo';
function  DrawBitmap; external APPTOOL5 Name 'DrawBitmap';
function  DrawSlide; external APPTOOL5 Name 'DrawSlide';
function  ksDrawSlideFromFile; external APPTOOL5 Name 'ksDrawSlideFromFile';
function  WriteSlide; external APPTOOL5 Name 'WriteSlide';
procedure ksSlideBackground; external APPTOOL5 Name 'ksSlideBackground';
function  ReadDouble; external APPTOOL5 Name 'ReadDouble';
function  ReadInt; external APPTOOL5 Name 'ReadInt';
function  ReadString; external APPTOOL5 Name 'ReadString';
function  ReadLong; external APPTOOL5 Name 'ReadLong';
function  FullFileName; external APPTOOL5 Name 'FullFileName';
function  UniqueFileName; external APPTOOL5 Name 'UniqueFileName';
procedure RemoveUniqueFile; external APPTOOL5 Name 'RemoveUniqueFile';
function  GetRightFileName; external APPTOOL5 Name 'GetRightFileName';
function  CommandWindow; external APPTOOL5 Name 'CommandWindow';
function  ksCursor; external APPTOOL5 Name 'Cursor';
function  Placement; external APPTOOL5 Name 'Placement';
function  ksChangeObjectInLibRequest; external APPTOOL5 Name 'ksChangeObjectInLibRequest';
function  ksIsCursorOrPlacementDocument; external APPTOOL5 Name 'ksIsCursorOrPlacementDocument';
function  ksIsActiveProcessRunnig; external APPTOOL5 Name 'ksIsActiveProcessRunnig';
function  ksPhantomShowHide; external APPTOOL5 Name 'ksPhantomShowHide';
function  ksGetCursorPosition; external APPTOOL5 Name 'ksGetCursorPosition';
function  SystemControlStart; external APPTOOL5 Name 'SystemControlStart';
procedure SystemControlStop; external APPTOOL5 Name 'SystemControlStop';
function  KeepReference; external APPTOOL5 Name 'KeepReference';
function  SetMacroParam; external APPTOOL5 Name 'SetMacroParam';
function  GetMacroParam; external APPTOOL5 Name 'GetMacroParam';
function  GetMacroParamSize; external APPTOOL5 Name 'GetMacroParamSize';
function  EditMacroMode; external APPTOOL5 Name 'EditMacroMode';
function  DeleteObj; external APPTOOL5 Name 'DeleteObj';
function  MoveObj; external APPTOOL5 Name 'MoveObj';
function  RotateObj; external APPTOOL5 Name 'RotateObj';
function  TransformObj; external APPTOOL5 Name 'TransformObj';
function  LightObj; external APPTOOL5 Name 'LightObj';
function  SymmetryObj; external APPTOOL5 Name 'SymmetryObj';
function  ksSymmetryObj; external APPTOOL5 Name 'ksSymmetryObj';
function  CopyObj; external APPTOOL5 Name 'CopyObj';
function  ksCopyObj; external APPTOOL5 Name 'ksCopyObj';
function  ksCreateViewObject; external APPTOOL5 Name 'ksCreateViewObject';
function  ksEditViewObject; external APPTOOL5 Name 'ksEditViewObject';
function  SetObjParam; external APPTOOL5 Name 'SetObjParam';
function  GetObjParam; external APPTOOL5 Name 'GetObjParam';
function  GetStyleParam; external APPTOOL5 Name 'GetStyleParam';
function  AddStyle; external APPTOOL5 Name 'AddStyle';
function  ksIsStyleInDocument; external APPTOOL5 Name 'ksIsStyleInDocument';
function  ksDeleteStyleFromDocument; external APPTOOL5 Name 'ksDeleteStyleFromDocument';
function  ExistObj; external APPTOOL5 Name 'ExistObj';
function  FindObj; external APPTOOL5 Name 'FindObj';
function  GetObjGabaritRect; external APPTOOL5 Name 'GetObjGabaritRect';
function  ViewToSheet; external APPTOOL5 Name 'ViewToSheet';
function  SheetToView; external APPTOOL5 Name 'SheetToView';
function  NewGroup; external APPTOOL5 Name 'NewGroup';
procedure EndGroup; external APPTOOL5 Name 'EndGroup';
function  ClearGroup; external APPTOOL5 Name 'ClearGroup';
function  ExcludeObjGroup; external APPTOOL5 Name 'ExcludeObjGroup';
function  AddObjGroup; external APPTOOL5 Name 'AddObjGroup';
function  StoreTmpGroup; external APPTOOL5 Name 'StoreTmpGroup';
function  SaveGroup; external APPTOOL5 Name 'SaveGroup';
function  GetGroup; external APPTOOL5 Name 'GetGroup';
function  SelectGroup; external APPTOOL5 Name 'SelectGroup';
function  ExistGroupObj; external APPTOOL5 Name 'ExistGroupObj';
function  ksWriteGroupToClip; external APPTOOL5 Name 'ksWriteGroupToClip';
function  ksReadGroupFromClip; external APPTOOL5 Name 'ksReadGroupFromClip';
function  ksGetGroupName; external APPTOOL5 Name 'ksGetGroupName';
function  ksDestroyObjects; external APPTOOL5 Name 'ksDestroyObjects';
function  Mtr; external APPTOOL5 Name 'Mtr';
function  ksMtr; external APPTOOL5 Name 'ksMtr';
function  MtrForIGES; external APPTOOL5 Name 'MtrForIGES';
function  DeleteMtr; external APPTOOL5 Name 'DeleteMtr';
function  ksPointIntoMtr; external APPTOOL5 Name 'ksPointIntoMtr';
function  ksPointFromMtr; external APPTOOL5 Name 'ksPointFromMtr';
function  ksLengthIntoMtr; external APPTOOL5 Name 'ksLengthIntoMtr';
function  ksLengthFromMtr; external APPTOOL5 Name 'ksLengthFromMtr';
function  CreateIterator; external APPTOOL5 Name 'CreateIterator';
function  MoveIterator; external APPTOOL5 Name 'MoveIterator';
function  CreateAttrIterator; external APPTOOL5 Name 'CreateAttrIterator';
function  MoveAttrIterator; external APPTOOL5 Name 'MoveAttrIterator';
function  DeleteIterator; external APPTOOL5 Name 'DeleteIterator';
function  CreateArray; external APPTOOL5 Name 'CreateArray';
function  DeleteArray; external APPTOOL5 Name 'DeleteArray';
function  ClearArray; external APPTOOL5 Name 'ClearArray';
function  GetArrayCount; external APPTOOL5 Name 'GetArrayCount';
function  AddArrayItem; external APPTOOL5 Name 'AddArrayItem';
function  ExcludeArrayItem; external APPTOOL5 Name 'ExcludeArrayItem';
function  GetArrayItem; external APPTOOL5 Name 'GetArrayItem';
function  GetUserArrayItem; external APPTOOL5 Name 'GetUserArrayItem';
function  SetArrayItem; external APPTOOL5 Name 'SetArrayItem';
function  GetArrayType; external APPTOOL5 Name 'GetArrayType';
function  DecomposeObj; external APPTOOL5 Name 'DecomposeObj';
function  ksLoadNonDecomposSpecSymbols; external APPTOOL5 Name 'ksLoadNonDecomposSpecSymbols';
function  GetViewObjCount; external APPTOOL5 Name 'GetViewObjCount';
function  FragmentDefinition; external APPTOOL5 Name 'FragmentDefinition';
function  InsertFragment; external APPTOOL5 Name 'InsertFragment';
function  ksInsertFragmentEx; external APPTOOL5 Name 'ksInsertFragmentEx';
function  ReadFragment; external APPTOOL5 Name 'ReadFragment';
function  ksReadFragmentToGroup; external APPTOOL5 Name 'ksReadFragmentToGroup';
function  ksReadFragmentToGroupEx; external APPTOOL5 Name 'ksReadFragmentToGroupEx';
function  WriteFragment; external APPTOOL5 Name 'WriteFragment';
function  LocalFragmentDefinition; external APPTOOL5 Name 'LocalFragmentDefinition';
function  CloseLocalFragmentDefinition; external APPTOOL5 Name 'CloseLocalFragmentDefinition';
function  ksChoiceFragmentFromLib; external APPTOOL5 Name 'ksChoiceFragmentFromLib';
function  ksFragmentLibrary; external APPTOOL5 Name 'ksFragmentLibrary';
function  ksAddFragmentToLibrary; external APPTOOL5 Name 'ksAddFragmentToLibrary';
function  ksCheckFragmentLibrary; external APPTOOL5 Name 'ksCheckFragmentLibrary';
function  ksExistFragmentInLibrary; external APPTOOL5 Name 'ksExistFragmentInLibrary';
function  ReleaseReference; external APPTOOL5 Name 'ReleaseReference';
function  CreateDocument; external APPTOOL5 Name 'PascalCreateDocument';
function  OpenDocument; external APPTOOL5 Name 'OpenDocument';
function  SaveDocument; external APPTOOL5 Name 'SaveDocument';
function  ksSaveAsToRasterFormat; external APPTOOL5 Name 'ksSaveAsToRasterFormat';
function  CloseDocument; external APPTOOL5 Name 'CloseDocument';
function  ksGetCurrentDocument; external APPTOOL5 Name 'ksGetCurrentDocument';
function  OpenTechnicalDemand; external APPTOOL5 Name 'OpenTechnicalDemand';
function  CloseTechnicalDemand; external APPTOOL5 Name 'CloseTechnicalDemand';
function  SpecRough; external APPTOOL5 Name 'SpecRough';
function  ksSpecRough; external APPTOOL5 Name 'ksSpecRough';
function  OpenStamp; external APPTOOL5 Name 'OpenStamp';
function  CloseStamp; external APPTOOL5 Name 'CloseStamp';
function  ColumnNumber; external APPTOOL5 Name 'ColumnNumber';
function  ClearStamp; external APPTOOL5 Name 'ClearStamp';
function  GetStampColumnText; external APPTOOL5 Name 'GetStampColumnText';
function  SetStampColumnText; external APPTOOL5 Name 'SetStampColumnText';
function  GetReferenceDocumentPart; external APPTOOL5 Name 'GetReferenceDocumentPart';
function  CreateSheetView; external APPTOOL5 Name 'CreateSheetView';
function  GetViewReference; external APPTOOL5 Name 'GetViewReference';
function  GetViewNumber; external APPTOOL5 Name 'GetViewNumber';
function  OpenView; external APPTOOL5 Name 'OpenView';
function  NewViewNumber; external APPTOOL5 Name 'NewViewNumber';
function  Layer; external APPTOOL5 Name 'Layer';
function  GetLayerNumber; external APPTOOL5 Name 'GetLayerNumber';
function  GetLayerReference; external APPTOOL5 Name 'GetLayerReference';
function  ChangeObjectLayer; external APPTOOL5 Name 'ChangeObjectLayer';
function  Point; external APPTOOL5 Name 'Point';
function  LineSeg; external APPTOOL5 Name 'LineSeg';
function  AnnLineSeg; external APPTOOL5 Name 'AnnLineSeg';
function  PointArraw; external APPTOOL5 Name 'PointArraw';
function  AnnArcByPoint; external APPTOOL5 Name 'AnnArcByPoint';
function  Line; external APPTOOL5 Name 'Line';
function  ArcByAngle; external APPTOOL5 Name 'ArcByAngle';
function  ArcBy3Points; external APPTOOL5 Name 'ArcBy3Points';
function  ArcByPoint; external APPTOOL5 Name 'ArcByPoint';
function  Circle; external APPTOOL5 Name 'Circle';
function  ksEllipse; external APPTOOL5 Name 'ksEllipse';
function  ksEllipseArc; external APPTOOL5 Name 'ksEllipseArc';
function  Equidistant; external APPTOOL5 Name 'Equidistant';
function  NurbsForConicCurve; external APPTOOL5 Name 'NurbsForConicCurve';
function  Paragraph; external APPTOOL5 Name 'Paragraph';
function  TextLine; external APPTOOL5 Name 'TextLine';
function  ksText; external APPTOOL5 Name 'Text';
function  ksConvertTextToCurve; external APPTOOL5 Name 'ksConvertTextToCurve';
function  Contour; external APPTOOL5 Name 'Contour';
function  ksIsPointInsideContour; external APPTOOL5 Name 'ksIsPointInsideContour';
function  Macro; external APPTOOL5 Name 'Macro';
function  ksOpenMacro; external APPTOOL5 Name 'ksOpenMacro';
function  EndObj; external APPTOOL5 Name 'EndObj';
function  ksAddObjectToMacro; external APPTOOL5 Name 'ksAddObjectToMacro';
function  Hatch; external APPTOOL5 Name 'Hatch';
function  ksColouring; external APPTOOL5 Name 'ksColouring';
function  ksDuplicateBoundaries; external APPTOOL5 Name 'ksDuplicateBoundaries';
function  ksDuplicateBoundariesEx; external APPTOOL5 Name 'ksDuplicateBoundariesEx';
function  BezierPoint; external APPTOOL5 Name 'BezierPoint';
function  NurbsPoint; external APPTOOL5 Name 'NurbsPoint';
function  ksNurbsKnot; external APPTOOL5 Name 'ksNurbsKnot';
function  Bezier; external APPTOOL5 Name 'Bezier';
function  _Bezier; external APPTOOL5 Name '_Bezier';
function  Nurbs; external APPTOOL5 Name 'Nurbs';
function  ksConicArc; external APPTOOL5 Name 'ksConicArc';
function  ksPolyline; external APPTOOL5 Name 'ksPolyline';
function  _ksPolyline; external APPTOOL5 Name '_ksPolyline';
function  ksIsCurveClosed; external APPTOOL5 Name 'ksIsCurveClosed';
function  Table; external APPTOOL5 Name 'Table';
function  ksOpenTable; external APPTOOL5 Name 'ksOpenTable';
function  ksRebuildTableVirtualGrid; external APPTOOL5 Name 'ksRebuildTableVirtualGrid';
function  ksGetTableItemsCount; external APPTOOL5 Name 'ksGetTableItemsCount';
function  ksGetTableColumnText; external APPTOOL5 Name 'ksGetTableColumnText';
function  ksSetTableColumnText; external APPTOOL5 Name 'ksSetTableColumnText';
function  ksClearTableColumnText; external APPTOOL5 Name 'ksClearTableColumnText';
function  ksCombineTwoTableItems; external APPTOOL5 Name 'ksCombineTwoTableItems';
function  ksDivideTableItem; external APPTOOL5 Name 'ksDivideTableItem';
function  ksSetTableBorderStyle; external APPTOOL5 Name 'ksSetTableBorderStyle';
function  ksGetTableBorderStyle; external APPTOOL5 Name 'ksGetTableBorderStyle';
function  LinDimension; external APPTOOL5 Name 'LinDimension';
function  DiamDimension; external APPTOOL5 Name 'DiamDimension';
function  RadDimension; external APPTOOL5 Name 'RadDimension';
function  RadBreakDimension; external APPTOOL5 Name 'RadBreakDimension';
function  AngDimension; external APPTOOL5 Name 'AngDimension';
function  Rough; external APPTOOL5 Name 'Rough';
function  Leader; external APPTOOL5 Name 'Leader';
function  PositionLeader; external APPTOOL5 Name 'PositionLeader';
function  BrandLeader; external APPTOOL5 Name 'BrandLeader';
function  MarkerLeader; external APPTOOL5 Name 'MarkerLeader';
function  Base; external APPTOOL5 Name 'Base';
function  CutLine; external APPTOOL5 Name 'PascalCutLine';
function  ViewPointer; external APPTOOL5 Name 'ViewPointer';
function  Tolerance; external APPTOOL5 Name 'Tolerance';
function  ksOpenTolerance; external APPTOOL5 Name 'ksOpenTolerance';
function  ksGetToleranceColumnText; external APPTOOL5 Name 'ksGetToleranceColumnText';
function  ksSetToleranceColumnText; external APPTOOL5 Name 'ksSetToleranceColumnText';
function  ksGetPointOnToleranceTable; external APPTOOL5 Name 'ksGetPointOnToleranceTable';
function  ksApproximationCurve; external APPTOOL5 Name 'ksApproximationCurve';
function  ksEqualPoints; external APPTOOL5 Name 'ksEqualPoints';
function  Angle; external APPTOOL5 Name 'Angle';
function  CosD; external APPTOOL5 Name 'CosD';
function  SinD; external APPTOOL5 Name 'SinD';
function  TanD; external APPTOOL5 Name 'TanD';
function  AtanD; external APPTOOL5 Name 'AtanD';
procedure IntersectLinSLinS; external APPTOOL5 Name 'IntersectLinSLinS';
procedure IntersectLinLin; external APPTOOL5 Name 'IntersectLinLin';
procedure IntersectCirCir; external APPTOOL5 Name 'IntersectCirCir';
procedure IntersectArcArc; external APPTOOL5 Name 'IntersectArcArc';
procedure IntersectLinSArc; external APPTOOL5 Name 'IntersectLinSArc';
procedure IntersectLinSCir; external APPTOOL5 Name 'IntersectLinSCir';
procedure IntersectCirLin; external APPTOOL5 Name 'IntersectCirLin';
procedure IntersectCirArc; external APPTOOL5 Name 'IntersectCirArc';
procedure IntersectCurvCurv; external APPTOOL5 Name 'IntersectCurvCurv';
procedure TanLinePointCircle; external APPTOOL5 Name 'TanLinePointCircle';
procedure TanLineAngCircle; external APPTOOL5 Name 'TanLineAngCircle';
function  TanCircleCircle; external APPTOOL5 Name 'TanCircleCircle';
procedure CouplingLineLine; external APPTOOL5 Name 'CouplingLineLine';
procedure ksCouplingLineCircle; external APPTOOL5 Name 'ksCouplingLineCircle';
procedure ksCouplingCircleCircle; external APPTOOL5 Name 'ksCouplingCircleCircle';
procedure Symmetry; external APPTOOL5 Name 'Symmetry';
procedure Rotate; external APPTOOL5 Name 'Rotate';
function  DistancePntPnt; external APPTOOL5 Name 'DistancePntPnt';
function  ksDistancePntLineSeg; external APPTOOL5 Name 'ksDistancePntLineSeg';
function  ksDistancePntArc; external APPTOOL5 Name 'ksDistancePntArc';
function  ksDistancePntCircle; external APPTOOL5 Name 'ksDistancePntCircle';
function  ksDistancePntLine; external APPTOOL5 Name 'ksDistancePntLine';
function  ksDistancePntLineForPoint; external APPTOOL5 Name 'ksDistancePntLineForPoint';
procedure Perpendicular; external APPTOOL5 Name 'Perpendicular';
function  ksCreateAttrType; external APPTOOL5 Name 'ksCreateAttrType';
function  DeleteAttrType; external APPTOOL5 Name 'DeleteAttrType';
function  ksGetAttrType; external APPTOOL5 Name 'ksGetAttrType';
function  ksSetAttrType; external APPTOOL5 Name 'ksSetAttrType';
function  CreateAttr; external APPTOOL5 Name 'CreateAttr';
function  DeleteAttr; external APPTOOL5 Name 'DeleteAttr';
function  GetAttrValue; external APPTOOL5 Name 'GetAttrValue';
function  SetAttrValue; external APPTOOL5 Name 'SetAttrValue';
function  GetAttrRow; external APPTOOL5 Name 'GetAttrRow';
function  ksGetAttrRow; external APPTOOL5 Name 'ksGetAttrRow';
function  SetAttrRow; external APPTOOL5 Name 'SetAttrRow';
function  ksSetAttrRow; external APPTOOL5 Name 'ksSetAttrRow';
function  ksAddAttrRow; external APPTOOL5 Name 'ksAddAttrRow';
function  ksSetAttrValue; external APPTOOL5 Name 'ksSetAttrValue';
function  ksDeleteAttrRow; external APPTOOL5 Name 'ksDeleteAttrRow';
function  ksGetSizeAttrValue; external APPTOOL5 Name 'ksGetSizeAttrValue';
function  ksGetSizeAttrRow; external APPTOOL5 Name 'ksGetSizeAttrRow';
function  GetAttrKeysInfo; external APPTOOL5 Name 'GetAttrKeysInfo';
function  GetAttrColumnInfo; external APPTOOL5 Name 'GetAttrColumnInfo';
function  GetAttrTabInfo; external APPTOOL5 Name 'GetAttrTabInfo';
function  ViewEditAttr; external APPTOOL5 Name 'ViewEditAttr';
function  ViewEditAttrType; external APPTOOL5 Name 'ViewEditAttrType';
function  ChoiceAttrTypes; external APPTOOL5 Name 'ChoiceAttrTypes';
function  ChoiceAttr; external APPTOOL5 Name 'ChoiceAttr';
function  ksGetLibraryAttrTypesArray; external APPTOOL5 Name 'ksGetLibraryAttrTypesArray';
function  GetTextLength; external APPTOOL5 Name 'GetTextLength';
function  GetTextLengthFromReference; external APPTOOL5 Name 'GetTextLengthFromReference';
procedure MovePoint; external APPTOOL5 Name 'MovePoint';
function  ksZoom; external APPTOOL5 Name 'ksZoom';
function  ksZoomScale; external APPTOOL5 Name 'ksZoomScale';
function  ksZoomPrevNextOrAll; external APPTOOL5 Name 'ksZoomPrevNextOrAll';
function  ksGetZoomScale; external APPTOOL5 Name 'ksGetZoomScale';
function  ksRefreshActiveWindow; external APPTOOL5 Name 'ksRefreshActiveWindow';
function  ksSystemPath; external APPTOOL5 Name 'ksSystemPath';
procedure ksGetRelativePathFromSystemPath; external APPTOOL5 Name 'ksGetRelativePathFromSystemPath';
procedure ksGetFullPathFromSystemPath; external APPTOOL5 Name 'ksGetFullPathFromSystemPath';
procedure ksGetRelativePathFromFullPath; external APPTOOL5 Name 'ksGetRelativePathFromFullPath';
procedure ksGetFullPathFromRelativePath; external APPTOOL5 Name 'ksGetFullPathFromRelativePath';
function  ksGetSystemVersion; external APPTOOL5 Name 'ksGetSystemVersion';
function  ksGetSystemProfileString; external APPTOOL5 Name 'ksGetSystemProfileString';
procedure ksOpenHelpFile; external APPTOOL5 Name 'ksOpenHelpFile';
function  ksSpcObjectCreate; external APPTOOL5 Name 'ksSpcObjectCreate';
function  ksSpcObjectEdit; external APPTOOL5 Name 'ksSpcObjectEdit';
function  ksSpcObjectEnd; external APPTOOL5 Name 'ksSpcObjectEnd';
function  ksSpcChangeValue; external APPTOOL5 Name 'ksSpcChangeValue';
function  ksSpcVisible; external APPTOOL5 Name 'ksSpcVisible';
function  ksSpcMassa; external APPTOOL5 Name 'ksSpcMassa';
function  ksSpcCount; external APPTOOL5 Name 'ksSpcCount';
function  ksSpcPosition; external APPTOOL5 Name 'ksSpcPosition';
function  ksSpcIncludeReference; external APPTOOL5 Name 'ksSpcIncludeReference';
function  ksGetSpcObjForGeom; external APPTOOL5 Name 'ksGetSpcObjForGeom';
function  ksGetSpcObjForGeomWithLimit; external APPTOOL5 Name 'ksGetSpcObjForGeomWithLimit';
function  ksEditWindowSpcObject; external APPTOOL5 Name 'ksEditWindowSpcObject';
function  ksGetSpcSectionName; external APPTOOL5 Name 'ksGetSpcSectionName';
function  ksGetSpcObjectNumber; external APPTOOL5 Name 'ksGetSpcObjectNumber';
function  CreateSpcIterator; external APPTOOL5 Name 'CreateSpcIterator';
function  ksGetSpcObject; external APPTOOL5 Name 'ksGetSpcObject';
function  ksGetSpcObjectColumnText; external APPTOOL5 Name 'ksGetSpcObjectColumnText';
function  ksSetSpcObjectColumnText; external APPTOOL5 Name 'ksSetSpcObjectColumnText';
function  ksGetSpcTableColumn; external APPTOOL5 Name 'ksGetSpcTableColumn';
function  ksGetSpcColumnType; external APPTOOL5 Name 'ksGetSpcColumnType';
function  ksGetSpcColumnNumb; external APPTOOL5 Name 'ksGetSpcColumnNumb';
function  ksGetSpcSheetSB; external APPTOOL5 Name 'ksGetSpcSheetSB';
function  ksSetSpcSheetSB; external APPTOOL5 Name 'ksSetSpcSheetSB';
function  GetDocOptions; external APPTOOL5 Name 'GetDocOptions';
function  SetDocOptions; external APPTOOL5 Name 'SetDocOptions';
function  ksSetSysOptions; external APPTOOL5 Name 'ksSetSysOptions';
function  ksGetSysOptions; external APPTOOL5 Name 'ksGetSysOptions';
function  ksPrintPreviewWindow; external APPTOOL5 Name 'ksPrintPreviewWindow';
function  ksGetSpcDocumentPagesCount; external APPTOOL5 Name 'ksGetSpcDocumentPagesCount';
function  ksDrawKompasDocument; external APPTOOL5 Name 'ksDrawKompasDocument';
function  ksDrawKompasGroup; external APPTOOL5 Name 'ksDrawKompasGroup';
function  ksPointsOnCurve; external APPTOOL5 Name 'ksPointsOnCurve';
function  ksGetCurvePerpendicular; external APPTOOL5 Name 'ksGetCurvePerpendicular';
function  ksGetCurvePointProjection; external APPTOOL5 Name 'ksGetCurvePointProjection';
function  ksMovePointOnCurve; external APPTOOL5 Name 'ksMovePointOnCurve';
function  ksGetLibraryStylesArray; external APPTOOL5 Name 'ksGetLibraryStylesArray';
function  ksReadTableFromFile; external APPTOOL5 Name 'ksReadTableFromFile';
function  ksGetCurvePerimeter; external APPTOOL5 Name 'ksGetCurvePerimeter';
function  ksCalcInertiaProperties; external APPTOOL5 Name 'ksCalcInertiaProperties';
function  ksCalcMassInertiaProperties; external APPTOOL5 Name 'ksCalcMassInertiaProperties';
function  ksViewGetObjectArea; external APPTOOL5 Name 'ksViewGetObjectArea';
function  ksViewGetDensity; external APPTOOL5 Name 'ksViewGetDensity';
function  ksCalculate; external APPTOOL5 Name 'ksCalculate';
function  ksCalculateReset; external APPTOOL5 Name 'ksCalculateReset';
function  ksGetDocVariableArray; external APPTOOL5 Name 'ksGetDocVariableArray';
function  ksSetDocVariableArray; external APPTOOL5 Name 'ksSetDocVariableArray';
function  ksCentreMarker; external APPTOOL5 Name 'ksCentreMarker';
function  ksRectangle; external APPTOOL5 Name 'ksRectangle';
function  ksRegularPolygon; external APPTOOL5 Name 'ksRegularPolygon';
function  ksGetZona; external APPTOOL5 Name 'ksGetZona';
function  GetMacroPlacement; external APPTOOL5 Name 'GetMacroPlacement';
function  SetMacroPlacement; external APPTOOL5 Name 'SetMacroPlacement';
function  ksSetObjConstraint; external APPTOOL5 Name 'ksSetObjConstraint';
function  ksGetObjConstraints; external APPTOOL5 Name 'ksGetObjConstraints';
function  ksDestroyObjConstraint; external APPTOOL5 Name 'ksDestroyObjConstraint';
function  ksInsertRaster; external APPTOOL5 Name 'ksInsertRaster';
function  ksExecuteLibraryCommand; external APPTOOL5 Name 'ksExecuteLibraryCommand';
function  ksGetSpcStyleParam; external APPTOOL5 Name 'ksGetSpcStyleParam';
function  ksGetSpcDescription; external APPTOOL5 Name 'ksGetSpcDescription';
function  ksSetSpcDescription; external APPTOOL5 Name 'ksSetSpcDescription';
function  ksAddSpcDescription; external APPTOOL5 Name 'ksAddSpcDescription';
function  ksDeleteSpcDescription; external APPTOOL5 Name 'ksDeleteSpcDescription';
function  ksClearRegion; external APPTOOL5 Name 'ksClearRegion';
function  ksSetCriticalProcess; external APPTOOL5 Name 'ksSetCriticalProcess';
function  ksGetMacroEditParam; external APPTOOL5 Name 'ksGetMacroEditParam';
function  ksClearGroup; external APPTOOL5 Name 'ksClearGroup';
function  ksMakeEncloseContours; external APPTOOL5 Name 'ksMakeEncloseContours';
function  ksHatch; external APPTOOL5 Name 'ksHatch';
function  LinBreakDimension; external APPTOOL5 Name 'LinBreakDimension';
function  AngBreakDimension; external APPTOOL5 Name 'AngBreakDimension';
function  ksSpecificationOnSheet; external APPTOOL5 Name 'ksSpecificationOnSheet';
function  ksConvertLangStr; external APPTOOL5 Name 'ksConvertLangStr';
function  ksConvertLangWindow; external APPTOOL5 Name 'ksConvertLangWindow';
function  ksConvertLangMenu; external APPTOOL5 Name 'ksConvertLangMenu';
function  ksGetQualityDefects; external APPTOOL5 Name 'ksGetQualityDefects';
function  ksCreateQualityIterator; external APPTOOL5 Name 'ksCreateQualityIterator';
function  ksMoveQualityIterator; external APPTOOL5 Name 'ksMoveQualityIterator';
function  ksGetQualityContensParam; external APPTOOL5 Name 'ksGetQualityContensParam';
function  ksGetQualityNames; external APPTOOL5 Name 'ksGetQualityNames';
procedure IntersectLinSLine; external APPTOOL5 Name 'IntersectLinSLine';
procedure IntersectArcLin; external APPTOOL5 Name 'IntersectArcLin';
function  ksSetCurrentLibrary; external APPTOOL5 Name 'ksSetCurrentLibrary';
function  ksTolerance; external APPTOOL5 Name 'ksTolerance';
function  ksSheetSetupDlg; external APPTOOL5 Name 'ksSheetSetupDlg';
function  ksMaterialDlg; external APPTOOL5 Name 'ksMaterialDlg';
function  ksExecDialPredefinedText; external APPTOOL5 Name 'ksExecDialPredefinedText';
function  ksGetSpcObjectColumnValues; external APPTOOL5 Name 'ksGetSpcObjectColumnValues';
function  ksHatchEx; external APPTOOL5 Name 'ksHatchEx';
function  ksOrdinatedDimension; external APPTOOL5 Name 'ksOrdinatedDimension';
function  ksIntersectCurvCurv; external APPTOOL5 Name 'ksIntersectCurvCurv';
function  ksTanLinePointCurve; external APPTOOL5 Name 'ksTanLinePointCurve';
function  ksReDrawDocPart; external APPTOOL5 Name 'ksReDrawDocPart';
function  ksGetWidthColumnSpc; external APPTOOL5 Name 'ksGetWidthColumnSpc';
procedure ksEnableUndo; external APPTOOL5 Name 'ksEnableUndo';
function  IsVisibleOrHiddenArraysInObject; external APPTOOL5 Name 'IsVisibleOrHiddenArraysInObject';
function  IsObjFromAssociativeView; external APPTOOL5 Name 'IsObjFromAssociativeView';
function  IsGeomObject; external APPTOOL5 Name 'IsGeomObject';
function  ksGetCurrentSpcObject; external APPTOOL5 Name 'ksGetCurrentSpcObject';
function  ksSetCurrentSpcObject; external APPTOOL5 Name 'ksSetCurrentSpcObject';
function  ksIsModuleSpecificationActive; external APPTOOL5 Name 'ksIsModuleSpecificationActive';
function  ksModuleSpecification; external APPTOOL5 Name 'ksModuleSpecification';
function  ksSetMacroParam; external APPTOOL5 Name 'ksSetMacroParam';
function  ksGetCursorLimit; external APPTOOL5 Name 'ksGetCursorLimit';
function  ksTrimCurve; external APPTOOL5 Name 'ksTrimCurve';
function  ksPrintKompasDocument; external APPTOOL5 Name 'ksPrintKompasDocument';
function  ksDrawSlideEx; external APPTOOL5 Name 'ksDrawSlideEx';
function  ksViewGetDensityAndMaterial; external APPTOOL5 Name 'ksViewGetDensityAndMaterial';
function  ksEditTextLine; external APPTOOL5 Name 'ksEditTextLine';
function  HatchEx; external APPTOOL5 Name 'HatchEx';
function  ksPolylineEx; external APPTOOL5 Name 'ksPolylineEx';
function  ksAddPowerForm; external APPTOOL5 Name 'ksAddPowerForm';
function  ksCreatePowerArc; external APPTOOL5 Name 'ksCreatePowerArc';
function  ksTrimNurbs; external APPTOOL5 Name 'ksTrimNurbs';
function  ksPointsOnCurveByStep; external APPTOOL5 Name 'ksPointsOnCurveByStep';
function  ksDistancePntPntOnCurve; external APPTOOL5 Name 'ksDistancePntPntOnCurve';
function  ksIsLibraryEnabled; external APPTOOL5 Name 'ksIsLibraryEnabled';
function  ksGetTextAlign; external APPTOOL5 Name 'ksGetTextAlign';
function  ksSetTextAlign; external APPTOOL5 Name 'ksSetTextAlign';
function  ksGetDimensionVariableName; external APPTOOL5 Name 'ksGetDimensionVariableName';
function  ksGetLeaderShelfLength; external APPTOOL5 Name 'ksGetLeaderShelfLength';
function  ksGetDocumentType; external APPTOOL5 Name 'ksGetDocumentType';
function  ksGetTxtDocumentPagesCount; external APPTOOL5 Name 'ksGetTxtDocumentPagesCount';
function  ksRemoteElement; external APPTOOL5 Name 'ksRemoteElement';
function  ksSetTuningSpcStyleParam; external APPTOOL5 Name 'ksSetTuningSpcStyleParam';
function  ksGetTuningSpcStyleParam; external APPTOOL5 Name 'ksGetTuningSpcStyleParam';
function  ksGetSpcObjGeometry; external APPTOOL5 Name 'ksGetSpcObjGeometry';
function  ksGetDocumentTypeByName; external APPTOOL5 Name 'ksGetDocumentTypeByName';
function  ksGetSpcObjectColumnTextEx; external APPTOOL5 Name 'ksGetSpcObjectColumnTextEx';
function  ksSetSpcObjectColumnTextEx; external APPTOOL5 Name 'ksSetSpcObjectColumnTextEx';
function  ksConnectionAdvise; external APPTOOL5 Name 'ksConnectionAdvise';
function  ksConnectionUnadvise; external APPTOOL5 Name 'ksConnectionUnadvise';

function  ksConvertLangStrEx; external APPTOOL5 Name 'ksConvertLangStrEx';
function  ksConvertLangWindowEx; external APPTOOL5 Name 'ksConvertLangWindowEx';
function  ksGetObject2DNotifyResult; external APPTOOL5 Name 'ksGetObject2DNotifyResult';
function  ksUpdateMacro; external APPTOOL5 Name 'ksUpdateMacro';
function  ksGetLibraryTreeStruct; external APPTOOL5 Name 'ksGetLibraryTreeStruct';
function  ksSaveAsToUncompressedRasterFormat; external APPTOOL5 Name 'ksSaveAsToUncompressedRasterFormat';
function  ksRebuildDocument; external APPTOOL5 Name 'ksRebuildDocument';
function  ksSetMaterialParam; external APPTOOL5 Name 'ksSetMaterialParam';
function  ksCreateSheetArbitraryView; external APPTOOL5 Name 'ksCreateSheetArbitraryView';
function  ksCreateSheetStandartViews; external APPTOOL5 Name 'ksCreateSheetStandartViews';
function  ksCreateSheetProjectionView; external APPTOOL5 Name 'ksCreateSheetProjectionView';
function  ksCreateSheetArrowView; external APPTOOL5 Name 'ksCreateSheetArrowView';
function  ksCreateSheetSectionView; external APPTOOL5 Name 'ksCreateSheetSectionView';
function  ksCreateSheetRemoteView; external APPTOOL5 Name 'ksCreateSheetRemoteView';
function  ksDrawKompasDocumentByReference; external APPTOOL5 Name 'ksDrawKompasDocumentByReference';
function  ksChangeObjectsOrder; external APPTOOL5 Name 'ksChangeObjectsOrder';
function  ksAxisLine; external APPTOOL5 Name 'ksAxisLine';
function  ksSetTextLineAlign; external APPTOOL5 Name 'ksSetTextLineAlign';
function  ksIsSlaveSpcOpened; external APPTOOL5 Name 'ksIsSlaveSpcOpened';
function  ksGetLookStyle; external APPTOOL5 Name 'ksGetLookStyle';
function  ksSetLookStyle; external APPTOOL5 Name 'ksSetLookStyle';
function  ksGetOrthoMode; external APPTOOL5 Name 'ksGetOrthoMode';
function  ksSetOrthoMode; external APPTOOL5 Name 'ksSetOrthoMode';
function  ksGetExternalInterface;external APPTOOL5 Name 'ksGetExternalInterface';
function  ksGetCurvePointProjectionEx; external APPTOOL5 Name 'ksGetCurvePointProjectionEx';
function  ksGetCurvePoint; external APPTOOL5 Name 'ksGetCurvePoint';
function  ksGetMacroWaitDblClickEdit; external APPTOOL5 Name 'ksGetMacroWaitDblClickEdit';
function  ksSetMacroWaitDblClickEdit; external APPTOOL5 Name 'ksSetMacroWaitDblClickEdit';
function  ksGetCurveMinMaxParametr; external APPTOOL5 Name 'ksSetMacroWaitDblClickEdit';
function  ksDistanceT1T2OnCurve; external APPTOOL5 Name 'ksDistanceT1T2OnCurve';
function  ksCursorEx;   external APPTOOL5 Name 'CursorEx';
function  PlacementEx;  external APPTOOL5 Name 'PlacementEx';
function  DrawBitmapEx; external APPTOOL5 Name 'DrawBitmapEx';
function  ksCalcRasterScale; external APPTOOL5 Name 'ksCalcRasterScale';
function  ksGetParametrizationParam; external APPTOOL5 Name 'ksGetParametrizationParam';
function  ksParametrizeObjects; external APPTOOL5 Name 'ksParametrizeObjects';
function  ksTextEx; external APPTOOL5 Name 'ksTextEx';
function  ksColouringEx; external APPTOOL5 Name 'ksColouringEx';

function  ksTanCurvCurv; external APPTOOL5 Name 'ksTanCurvCurv';
function  ksGetSystemControlStartResult; external APPTOOL5 Name 'ksGetSystemControlStartResult';
function  ksGetSpcObjGeometryEx; external APPTOOL5 Name 'ksGetSpcObjGeometryEx';
function  SaveDocumentEx; external APPTOOL5 Name 'SaveDocumentEx';
function  ksSetSpcObjectColumnTextAlign; external APPTOOL5 Name 'ksSetSpcObjectColumnTextAlign';
function  OpenStampEx; external APPTOOL5 Name 'OpenStampEx';
function  ClearStampEx; external APPTOOL5 Name 'ClearStampEx';
function  GetReferenceDocumentPartEx; external APPTOOL5 Name 'GetReferenceDocumentPartEx';
function  ksAssociationViewMatrix3D; external APPTOOL5 Name 'ksAssociationViewMatrix3D';
function  ksGetDocumentPagesCount; external APPTOOL5 Name 'ksGetDocumentPagesCount';
function  ksPoint3DToAssociationView; external APPTOOL5 Name 'ksPoint3DToAssociationView';
function  ksGetSpcObjectColumnTextAlign; external APPTOOL5 Name 'ksGetSpcObjectColumnTextAlign';
function  ksGetSpcObjectAttributeNumber; external APPTOOL5 Name 'ksGetSpcObjectAttributeNumber';
function  ksSetSpcObjectAttributeNumber; external APPTOOL5 Name 'ksSetSpcObjectAttributeNumber';
function  ksGetSpcObjectSummaryCount; external APPTOOL5 Name 'ksGetSpcObjectSummaryCount';

function  ksModule3D; external APPTOOL5 Name 'ksModule3D';
function  ksIsModule3DActive; external APPTOOL5 Name 'ksIsModule3DActive';

function ksTransferInterface; external APPTOOL5 Name 'ksTransferInterface';
function ksExecuteKompasCommand; external APPTOOL5 Name 'ksExecuteKompasCommand';
function ksIsKompasCommandEnable; external APPTOOL5 Name 'ksIsKompasCommandEnable';
function ksIsKompasCommandCheck; external APPTOOL5 Name 'ksIsKompasCommandCheck';
procedure ksStartProgressBar; external APPTOOL5 Name 'ksStartProgressBar';
procedure ksSetProgressBar; external APPTOOL5 Name 'ksSetProgressBar';
procedure ksSetProgressText; external APPTOOL5 Name 'ksSetProgressText';
procedure ksStopProgressBar; external APPTOOL5 Name 'ksStopProgressBar';
function ksFileNameCompare; external APPTOOL5 Name 'ksFileNameCompare';

//  10
procedure StrResultW;     external APPTOOL5 Name 'StrResultW'
function  CommandWindowW; external APPTOOL5 Name 'CommandWindowW';
function  ksCursorExW;    external APPTOOL5 Name 'CursorExW';
function  PlacementExW;   external APPTOOL5 Name 'PlacementExW';
function  ksChangeObjectInLibRequestW; external APPTOOL5 Name 'ksChangeObjectInLibRequestW';
function  SystemControlStartW; external APPTOOL5 Name 'SystemControlStartW';
function  FullFileNameW; external APPTOOL5 Name 'FullFileNameW';
function  UniqueFileNameW; external APPTOOL5 Name 'UniqueFileNameW';
procedure RemoveUniqueFileW; external APPTOOL5 Name 'RemoveUniqueFileW';
function  GetRightFileNameW; external APPTOOL5 Name 'GetRightFileNameW';
function  GetTextLengthW; external APPTOOL5 Name 'GetTextLengthW';
function  ksSystemPathW; external APPTOOL5 Name 'ksSystemPathW';
procedure ksGetRelativePathFromSystemPathW; external APPTOOL5 Name 'ksGetRelativePathFromSystemPathW';
procedure ksGetFullPathFromSystemPathW; external APPTOOL5 Name 'ksGetFullPathFromSystemPathW';
procedure ksGetRelativePathFromFullPathW; external APPTOOL5 Name 'ksGetRelativePathFromFullPathW';
procedure ksGetFullPathFromRelativePathW; external APPTOOL5 Name 'ksGetFullPathFromRelativePathW';
function  ksGetSystemProfileStringW; external APPTOOL5 Name 'ksGetSystemProfileStringW';
procedure ksOpenHelpFileW; external APPTOOL5 Name 'ksOpenHelpFileW';
function  ksExecuteLibraryCommandW; external APPTOOL5 Name 'ksExecuteLibraryCommandW';
function  ksIsLibraryEnabledW; external APPTOOL5 Name 'ksIsLibraryEnabledW';
function ksGetQualityDefectsW; external APPTOOL5 Name 'ksGetQualityDefectsW';
function ksMoveQualityIteratorW; external APPTOOL5 Name 'ksMoveQualityIteratorW';
function ksGetQualityContensParamW; external APPTOOL5 Name 'ksGetQualityContensParamW';
function ksSetCurrentLibraryW; external APPTOOL5 Name 'ksSetCurrentLibraryW';
procedure ksConvertLangStrW; external APPTOOL5 Name 'ksConvertLangStrW';
function ksConvertLangStrExW; external APPTOOL5 Name 'ksConvertLangStrExW';
function ksConvertLangWindowExW; external APPTOOL5 Name 'ksConvertLangWindowExW';
function ksCalcRasterScaleW; external APPTOOL5 Name 'ksCalcRasterScaleW';
function ksTransferReference; external APPTOOL5 Name 'ksTransferReference';
function ksFileNameCompareW; external APPTOOL5 Name 'ksFileNameCompareW';
function ksCreateAttrTypeW; external APPTOOL5 Name 'ksCreateAttrTypeW';
function DeleteAttrTypeW; external APPTOOL5 Name 'DeleteAttrTypeW';
function ksGetAttrTypeW; external APPTOOL5 Name 'ksGetAttrTypeW';
function ksSetAttrTypeW; external APPTOOL5 Name 'ksSetAttrTypeW';
function ksCreateAttr; external APPTOOL5 Name 'ksCreateAttr';
function ksCreateAttrW; external APPTOOL5 Name 'ksCreateAttrW';
function DeleteAttrW; external APPTOOL5 Name 'DeleteAttrW';
function ksGetAttrValue; external APPTOOL5 Name 'ksGetAttrValue';
function ksGetAttrValueW; external APPTOOL5 Name 'ksGetAttrValueW';
function ksSetAttrValueW; external APPTOOL5 Name 'ksSetAttrValueW';
function ksGetAttrRowW; external APPTOOL5 Name 'ksGetAttrRowW';
function ksSetAttrRowW; external APPTOOL5 Name 'ksSetAttrRowW';
function ksAddAttrRowW; external APPTOOL5 Name 'ksAddAttrRowW';
function ksDeleteAttrRowW; external APPTOOL5 Name 'ksDeleteAttrRowW';
function ksGetSizeAttrValueW; external APPTOOL5 Name 'ksGetSizeAttrValueW';
function ksGetSizeAttrRowW; external APPTOOL5 Name 'ksGetSizeAttrRowW';
function GetAttrColumnInfoW; external APPTOOL5 Name 'GetAttrColumnInfoW';
function ViewEditAttrW; external APPTOOL5 Name 'ViewEditAttrW';
function ViewEditAttrTypeW; external APPTOOL5 Name 'ViewEditAttrTypeW';
function ChoiceAttrTypesW; external APPTOOL5 Name 'ChoiceAttrTypesW';
function ksGetLibraryAttrTypesArrayW; external APPTOOL5 Name 'ksGetLibraryAttrTypesArrayW';

function ksSetMacroParamW; external APPTOOL5 Name 'ksSetMacroParamW';
function ksGetMacroEditParamW; external APPTOOL5 Name 'ksGetMacroEditParamW';
function ksGetLibraryStylesArrayW; external APPTOOL5 Name 'ksGetLibraryStylesArrayW';
function SaveGroupW; external APPTOOL5 Name 'SaveGroupW';
function GetGroupW; external APPTOOL5 Name 'GetGroupW';
function ksGetGroupNameW; external APPTOOL5 Name 'ksGetGroupNameW';
function FragmentDefinitionW; external APPTOOL5 Name 'FragmentDefinitionW';
function ReadFragmentW; external APPTOOL5 Name 'ReadFragmentW';
function ksReadFragmentToGroupExW; external APPTOOL5 Name 'ksReadFragmentToGroupExW';
function WriteFragmentW; external APPTOOL5 Name 'WriteFragmentW';
function LocalFragmentDefinitionW; external APPTOOL5 Name 'LocalFragmentDefinitionW';
function ksChoiceFragmentFromLibW; external APPTOOL5 Name 'ksChoiceFragmentFromLibW';
function ksFragmentLibraryW; external APPTOOL5 Name 'ksFragmentLibraryW';
function ksAddFragmentToLibraryW; external APPTOOL5 Name 'ksAddFragmentToLibraryW';
function ksCheckFragmentLibraryW; external APPTOOL5 Name 'ksCheckFragmentLibraryW';
function ksExistFragmentInLibraryW; external APPTOOL5 Name 'ksExistFragmentInLibraryW';
function ksGetLibraryTreeStructW; external APPTOOL5 Name 'ksGetLibraryTreeStructW';
function CreateDocumentW; external APPTOOL5 Name 'CreateDocumentW';
function CreateTextDocumentW; external APPTOOL5 Name 'CreateTextDocumentW';
function OpenDocumentW; external APPTOOL5 Name 'OpenDocumentW';
function SaveDocumentExW; external APPTOOL5 Name 'SaveDocumentExW';
function ksSaveAsToRasterFormatW; external APPTOOL5 Name 'ksSaveAsToRasterFormatW';
function ksSaveAsToUncompressedRasterFormatW; external APPTOOL5 Name 'ksSaveAsToUncompressedRasterFormatW';
function CreateSheetViewW; external APPTOOL5 Name 'CreateSheetViewW';
function ksCreateSheetArbitraryViewW; external APPTOOL5 Name 'ksCreateSheetArbitraryViewW';
function ksCreateSheetStandartViewsW; external APPTOOL5 Name 'ksCreateSheetStandartViewsW';
function ksCreateSheetProjectionViewW; external APPTOOL5 Name 'ksCreateSheetProjectionViewW';
function ksCreateSheetArrowViewW; external APPTOOL5 Name 'ksCreateSheetArrowViewW';
function ksCreateSheetSectionViewW; external APPTOOL5 Name 'ksCreateSheetSectionViewW';
function ksCreateSheetRemoteViewW; external APPTOOL5 Name 'ksCreateSheetRemoteViewW';
function ksDrawKompasDocumentW; external APPTOOL5 Name 'ksDrawKompasDocumentW';
function ksReadTableFromFileW; external APPTOOL5 Name 'ksReadTableFromFileW';
function ksGetZonaW; external APPTOOL5 Name 'ksGetZonaW';
function ksPrintKompasDocumentW; external APPTOOL5 Name 'ksPrintKompasDocumentW';
function ksGetShelfPoint; external APPTOOL5 Name 'ksGetShelfPoint';
function ksGetDocumentTypeByNameW; external APPTOOL5 Name 'ksGetDocumentTypeByNameW';

function ksChoiceFileW; external APPTOOL5 Name 'ksChoiceFileW';
function ksChoiceFileAppointedDirW; external APPTOOL5 Name 'ksChoiceFileAppointedDirW';
function ksChoiceFilesW; external APPTOOL5 Name 'ksChoiceFilesW';
function ksSaveFileW; external APPTOOL5 Name 'ksSaveFileW';
function ksInitFilePreviewFuncW; external APPTOOL5 Name 'ksInitFilePreviewFuncW';
procedure ksMessageW; external APPTOOL5 Name 'MessageW';
procedure ErrorW; external APPTOOL5 Name 'ErrorW';
function YesNoW; external APPTOOL5 Name 'YesNoW';
function ksDrawSlideFromFileW; external APPTOOL5 Name 'ksDrawSlideFromFileW';
function WriteSlideW; external APPTOOL5 Name 'WriteSlideW';
function ReadDoubleW; external APPTOOL5 Name 'ReadDoubleW';
function ReadIntW; external APPTOOL5 Name 'ReadIntW';
function ReadStringW; external APPTOOL5 Name 'ReadStringW';
function ReadLongW; external APPTOOL5 Name 'ReadLongW';
function ksSheetSetupDlgW; external APPTOOL5 Name 'ksSheetSetupDlgW';
function ksExecDialPredefinedTextW; external APPTOOL5 Name 'ksExecDialPredefinedTextW';
function ksViewGetDensityAndMaterialW; external APPTOOL5 Name 'ksViewGetDensityAndMaterialW';
function ksEditTextLineW; external APPTOOL5 Name 'ksEditTextLineW';
procedure ksStartProgressBarW; external APPTOOL5 Name 'ksStartProgressBarW';
procedure ksSetProgressBarW; external APPTOOL5 Name 'ksSetProgressBarW';
procedure ksSetProgressTextW; external APPTOOL5 Name 'ksSetProgressTextW';
procedure ksStopProgressBarW; external APPTOOL5 Name 'ksStopProgressBarW';

function ksSpecRoughW; external APPTOOL5 Name 'ksSpecRoughW';
function TextLineW; external APPTOOL5 Name 'TextLineW';
function ksTextW; external APPTOOL5 Name 'TextW';
function ksInsertRasterW; external APPTOOL5 Name 'ksInsertRasterW';
function ChangeLeader; external APPTOOL5 Name 'ChangeLeader';
function BaseW; external APPTOOL5 Name 'BaseW';
function CutLineW; external APPTOOL5 Name 'CutLineW';
function ViewPointerW; external APPTOOL5 Name 'ViewPointerW';
function ksGetDimensionVariableNameW; external APPTOOL5 Name 'ksGetDimensionVariableNameW';

function ksSpcObjectCreateW; external APPTOOL5 Name 'ksSpcObjectCreateW';
function ksSpcChangeValueW; external APPTOOL5 Name 'ksSpcChangeValueW';
function ksSpcMassaW; external APPTOOL5 Name 'ksSpcMassaW';
function ksSpcCountW; external APPTOOL5 Name 'ksSpcCountW';
function ksGetSpcObjForGeomWithLimitW; external APPTOOL5 Name 'ksGetSpcObjForGeomWithLimitW';
function ksGetSpcSectionNameW; external APPTOOL5 Name 'ksGetSpcSectionNameW';
function CreateSpcIteratorW; external APPTOOL5 Name 'CreateSpcIteratorW';
function ksGetSpcObjectColumnTextW; external APPTOOL5 Name 'ksGetSpcObjectColumnTextW';
function ksSetSpcObjectColumnTextW; external APPTOOL5 Name 'ksSetSpcObjectColumnTextW';
function ksGetSpcTableColumnW; external APPTOOL5 Name 'ksGetSpcTableColumnW';
function ksGetSpcColumnTypeW; external APPTOOL5 Name 'ksGetSpcColumnTypeW';
function ksGetSpcSheetSB_W; external APPTOOL5 Name 'ksGetSpcSheetSB_W';
function ksGetSpcStyleParamW; external APPTOOL5 Name 'ksGetSpcStyleParamW';
function ksGetSpcDescriptionW; external APPTOOL5 Name 'ksGetSpcDescriptionW';
function ksSetSpcDescriptionW; external APPTOOL5 Name 'ksSetSpcDescriptionW';
function ksAddSpcDescriptionW; external APPTOOL5 Name 'ksAddSpcDescriptionW';
function ksSetTuningSpcStyleParamW; external APPTOOL5 Name 'ksSetTuningSpcStyleParamW';
function ksGetTuningSpcStyleParamW; external APPTOOL5 Name 'ksGetTuningSpcStyleParamW';
function CreateTextDocument; external APPTOOL5 Name 'CreateTextDocument';
function ksCalculateW; external APPTOOL5 Name 'ksCalculateW';
function ksSetSpcObjectMaterial; external APPTOOL5 Name 'ksSetSpcObjectMaterial';
function ksSetSpcObjectMaterialW; external APPTOOL5 Name 'ksSetSpcObjectMaterialW';
function ksDrawKompasText; external APPTOOL5 Name 'ksDrawKompasText';
function ksDrawKompasTextW; external APPTOOL5 Name 'ksDrawKompasTextW';
function ksGetSpcPerformanceName; external APPTOOL5 Name 'ksGetSpcPerformanceName';
function ksGetSpcPerformanceNameW; external APPTOOL5 Name 'ksGetSpcPerformanceNameW';
function ksSetSpcPerformanceName; external APPTOOL5 Name 'ksSetSpcPerformanceName';
function ksSetSpcPerformanceNameW; external APPTOOL5 Name 'ksSetSpcPerformanceNameW';
function ksPrintKompasDocumentEx; external APPTOOL5 Name 'ksPrintKompasDocumentEx';
function ksPrintKompasDocumentExW; external APPTOOL5 Name 'ksPrintKompasDocumentExW';
function ksParEllipseArc; external APPTOOL5 Name 'ksParEllipseArc';

//  11
procedure ksEnableThemeDialogTexture; external APPTOOL5 Name 'ksEnableThemeDialogTexture';
function ksMakeEncloseContoursEx; external APPTOOL5 Name 'ksMakeEncloseContoursEx';
function ksAnnPolylineEx; external APPTOOL5 Name 'ksAnnPolylineEx';
function ksAnnEllipseArc; external APPTOOL5 Name 'ksAnnEllipseArc';
function ksAnnParEllipseArc; external APPTOOL5 Name 'ksAnnParEllipseArc';
function ksAnnCircle; external APPTOOL5 Name 'ksAnnCircle';
function ksAnnEllipse; external APPTOOL5 Name 'ksAnnEllipse';
function ksAnnPolyline; external APPTOOL5 Name 'ksAnnPolyline';
function ksGetObjectStyle; external APPTOOL5 Name 'ksGetObjectStyle';
function ksSetObjectStyle; external APPTOOL5 Name 'ksSetObjectStyle';
function ksAnnTextEx; external APPTOOL5 Name 'ksAnnTextEx';
function ksAnnPoint; external APPTOOL5 Name 'ksAnnPoint';
function ksGetAnnObjTerminators; external APPTOOL5 Name 'ksGetAnnObjTerminators';
function ksExecDialSpecialSymbol; external APPTOOL5 Name 'ksExecDialSpecialSymbol';
function ksExecDialSymbol; external APPTOOL5 Name 'ksExecDialSymbol';
function ksExecDialSymbolW; external APPTOOL5 Name 'ksExecDialSymbolW';
function ksGetMacroPlacementEx; external APPTOOL5 Name 'ksGetMacroPlacementEx';
function ksSetMacroPlacementEx; external APPTOOL5 Name 'ksSetMacroPlacementEx';

//  12
function ksSpcDocLinksClear; external APPTOOL5 Name 'ksSetMacroPlacementEx';
function CopyGroupToDocument; external APPTOOL5 Name 'CopyGroupToDocument';
function ksExecDialLineStyleSelect; external APPTOOL5 Name 'ksExecDialLineStyleSelect';
function ksSetDebugMessagesMode; external APPTOOL5 Name 'ksSetDebugMessagesMode';


end.
