Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: CSharp, Created At: 10/24/2016 8:26:15 PMViews:

HTML view:
Copy Source | Copy HTML
function TForm2.DrawWD:Boolean;
var Iter: ksIterator;
      param:ksDimTextParam;
      iDimParams : ksLDimParam; //Структура Ð¾Ð¿Ð¸ÑÑ‹Ð²Ð°ÑŽÑ‰Ð°Ñ Ð»Ð¸Ð½ÐµÐ¹Ð½Ñ‹Ð¹ Ñ€Ð°Ð·Ð¼ÐµÑ€
      arr:ksDynamicArray;
      textLine : ksTextLineParam;
      textItem : ksTextItemParam;
      i,ref:Integer;
      kStr:ksChar255; //Вот Ñ‚акой ÑÐ¿ÐµÑ†Ð¸Ñ„ичный Ñ‚ип Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ñ… Ñ‚ам Ð¾Ð±Ð¸Ñ‚ает ))
begin
     Result:=False;
     Iter:=ksIterator(Kompas.GetIterator); //Снова Ð¸Ñ‚ератор Ð·Ð°Ð¿ÑƒÑÐºÐ°ÐµÐ¼
     If Iter.ksCreateIterator(LDIMENSION_OBJ, 0)=False then exit;
     //Привязали Ð¸Ñ‚ератор Ðº Ð»Ð¸Ð½ÐµÐ¹Ð½Ñ‹Ð¼ Ñ€Ð°Ð·Ð¼ÐµÑ€Ð°Ð¼
 
     ref:=Iter.ksMoveIterator('F');
     if Doc2.ksExistObj(ref)=1 then
       repeat // Ð¿ÐµÑ€ÐµÐ±Ð¸Ñ€Ð°ÐµÐ¼ Ð¾Ð±ÑŠÐµÐºÑ‚Ñ‹
 
          iDimParams := ksLDimParam(Kompas.GetParamStruct(ko_LDimParam));
          textLine := ksTextLineParam( kompas.GetParamStruct( ko_TextLineParam) );
          textItem := ksTextItemParam( kompas.GetParamStruct(ko_TextItemParam) );
          if ( (iDimParams = nil) Or (textLine = nil) Or (textItem = nil) ) then Exit;
          Doc2.ksGetObjParam(ref, iDimParams, ALLPARAM); //берём ÑÑÑ‹Ð»ÐºÑƒ Ð½Ð° Ð²ÑÐµ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ры Ð¾Ð±ÑŠÐµÐºÑ‚а
          param := ksDimTextParam( iDimParams.GetTPar ); //Закидываем Ñ‚екстовые Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ры Ð² Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½ÑƒÑŽ
          if param = nil then Exit;
          arr := ksDynamicArray( param.GetTextArr ); //Получаем Ð½ÐµÐºÐ¸Ð¹ Ð¼Ð°ÑÑÐ¸Ð² ÑÑ‚рок Ð¸Ð· ÑÑ‚руктуры Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ра
          if arr = nil then Exit;
 
          kStr:=ksChar255(kompas.GetParamStruct(ko_Char255));
          for I :=  0 to arr.ksGetArrayCount - 1 do begin //пробегаем Ð¿Ð¾ Ð¼Ð°ÑÑÐ¸Ð²Ñƒ Ð² Ð¿Ð¾Ð¸ÑÐºÐ°Ñ… ÑˆÐ°Ð±Ð»Ð¾Ð½Ð°
            arr.ksGetArrayItem(i,kStr);
 
            if '<L1>'=kStr.str then kStr.str:=Format('%1.1f',[L1]);
            if '<L2>'=kStr.str then kStr.str:=Format('%1.1f',[L2]);
            if '<L3>'=kStr.str then kStr.str:=Format('%1.0f',[L3]);
 
            if '<D1>'=kStr.str then kStr.str:=Format('%1.0f',[D1]);
            if '<D2>'=kStr.str then kStr.str:=Format('%1.0f',[D2]);
            if '<D3>'=kStr.str then kStr.str:=Format('%1.1f',[D3]);
            //Улучшить ÐºÐ¾Ð´ Ð¼Ð¾Ð¶Ð½Ð¾ Ð¿ÑƒÑ‚ём ÑƒÑ‚очнения Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ñ… (целое/дробное) Ð¸ Ð²Ð½ÐµÑÐµÐ½Ð¸Ðµ Ð¿Ð¾Ð¿Ñ€Ð°Ð²Ð¾Ðº Ð² Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ры Ñ„ункции Format()
 
            arr.ksSetArrayItem(i,kStr); //Заносим Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð¾Ð±Ñ€Ð°Ñ‚но Ð² Ð¼Ð°ÑÑÐ¸Ð²
          end;
 
          param.SetTextArr(arr); //Заносим Ð¼Ð°ÑÑÐ¸Ð² Ð² ÑÑ‚руктуру Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ра
          iDimParams.SetTPar(param); //Заносим ÑÑ‚руктуру Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚ра Ð² ÑÑ‚руктуру Ñ€Ð°Ð·Ð¼ÐµÑ€Ð°
 
          doc2.ksSetObjParam(ref,iDimParams,ALLPARAM); //И Ð²ÑÑ‘ ÑÑ‚о Ð² Ð´Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚ ÑÐ¾Ñ…раняем.
 
          ref:=Iter.ksMoveIterator('N');
       until Doc2.ksExistObj(ref)= 0;
     Iter.ksDeleteIterator;
 
     doc2.ksRebuildDocument;
     Result:=True;
end;
 

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018