-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


API -3D -> 2 ->

, 20 2017 . 18:48 +

API . , - , Delphi. .


, :
  • ksSheetPar , : ;
  • ksStandartSheet . , ;
  • ksSheetSize ( ).
    , .



ksSheetPar GetLayoutParam() ksDocumentParam, .
ksSheetPar :
  • layoutName . , graphic.lyt, Sys ;
  • shtType ( ) .


, ( ) . . .


( )

, ( ) . / . .




, layoutName. shtType . , . .


shtType . , . .




, layoutName.
. .




shtType . , . . 2.104-2006 ( ) shtType 1, . 2.104-2006. 42 ..

ksSheetPar :
  • Init() ;
  • GetSheetParam() ksStandartSheet ( ) ksSheetSize ( ).


( ) ksDocumentParam . .



ksStandartSheet, :
  • direct (FALSE , TRUE );
  • format (0 0, 1 1, 2 2, 3 3, 4 4, 5 5);
  • multiply .


, 4 .

KompasObjectPtr kompas;
// 
kompas.CreateInstance(L"KOMPAS.Application.5");

//  
DocumentParamPtr DocumentParam;
DocumentParam=(DocumentParamPtr)kompas->GetParamStruct(ko_DocumentParam);
DocumentParam->Init();
DocumentParam->type= lt_DocSheetStandart;//   

SheetParPtr SheetPar;
SheetPar = (SheetParPtr)DocumentParam->GetLayoutParam();
SheetPar->layoutName[0] = L'0';
SheetPar->shtType = 1;  // 

//  
StandartSheetPtr StandartSheet;
StandartSheet = (StandartSheetPtr)SheetPar->GetSheetParam();
StandartSheet->direct = false; //   
StandartSheet->format = 4;     //4
StandartSheet->multiply = 1;   //

// 
Document2DPtr Document2D;
Document2D = (Document2DPtr)kompas->Document2D();
Document2D->ksCreateDocument(DocumentParam);

//  
kompas->Visible = true;
kompas.Unbind();


, layoutName ksSheetPar . graphic.lyt, . .


. . 2.104-2006



ksSheetSize :
  • height ;
  • width .


, 300300 .

KompasObjectPtr kompas;
// 
kompas.CreateInstance(L"KOMPAS.Application.5");

//  
DocumentParamPtr DocumentParam;
DocumentParam=(DocumentParamPtr)kompas->GetParamStruct(ko_DocumentParam);
DocumentParam->Init();
DocumentParam->type = lt_DocSheetUser; //   

SheetParPtr SheetPar;
SheetPar = (SheetParPtr)DocumentParam->GetLayoutParam();
SheetPar->layoutName[0] = L'0';
SheetPar->shtType = 1;  // 

//  
SheetSizePtr SheetSize;
SheetSize = (SheetSizePtr)SheetPar->GetSheetParam();
SheetSize->Init();
SheetSize->width  = 300;
SheetSize->height = 300;

// 
Document2DPtr Document2D;
Document2D = (Document2DPtr)kompas->Document2D();
Document2D->ksCreateDocument(DocumentParam);

//  
kompas->Visible = true;
kompas.Unbind();


, type ksDocumentParam lt_DocSheetUser. GetSheetParam() ksSheetPar ksSheetSize.
.


300 300

, . , , . .


100 100 .

100100 , 1 ( . . 2.104-2006).

, .

, Delphi.
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/330588/

:  

: [1] []
 

:
: 

: ( )

:

  URL