CalWin
  • Introduction
  • Code Snippets
  • Useful SQL statements
  • CalWin Script
    • Hardware Script
      • GetQty
      • DefineParts
      • WorkXXX
      • Script classes
        • TWorkWrapper
        • TFrameWrapper
        • TDividerWrapper
    • System script Events
      • OnAdjustStainLoad
      • OnAfterCalcItemRequirement
      • OnCalcPriceListAddition
      • OnCalcProductPurchaseDeliveryTime
      • OnCalcSalesHeaderAutoLineData
      • OnCalcSashLeadWeight
      • OnCheckFromSemiStock
      • OnCheckFromStock
      • OnCheckGlassFromStock
      • OnCheckProduct
      • OnCheckSalesheaderRules
      • OnCheckSaleslineDates
      • OnGetBatchGroup
      • OnGetClassification
      • OnGetDiscountGroup
      • OnGetElementProfile
      • OnGetLoadPoints
      • OnGetProductSourceAltParams
      • OnGetProductSourceParams
      • OnGetprofile (deprecated)
      • OnGetSaleslinesSourceParams
      • OnGetStockItemGroup
      • OnIncludeBottleneckLoad
      • OnIncludeCheckpoint
      • OnIsSpecialProduct
      • OnModifyEdgeList
      • OnModifyKickPlate
      • OnModifyVariants_Final
      • OnModifyVariants_Initial
      • OnSalesheaderPriceFinalization
      • OnSetElementJointType
      • OnSetSileDividersPos
      • OnSetTranMullDesignCode
      • OnSetTranMullDividersPos
      • Helper Procedure Repository
        • Loop ElementList
    • Machine Link
      • Machine Link Events
        • Initialize and Finalize
        • BeforeOptimization
        • PreParseMain_xxx
        • PostParseMain_xxx
        • ParseChild_xxx
        • BeforeOutput_xxx
      • How to use a search table in Machine Link
  • Brukerdokumentasjon (NOR)
    • Fullkostkalkyle
    • Bonus og markedsstøtte
    • CalWin enhet og faktor
    • Kalenderen
    • Budsjett
    • Eksport til Excel
    • Dokument-håndtering
  • Misc documentation
    • CalWin 64-bit Beta
    • CalWin E-Quote
    • CalWin WEB Dashboard
    • Oracle related
      • Oracle Database Server Requirements
      • Oracle DBA
        • Resize and rename data files
        • Arhivelog mode
        • LISTENER.ORA
        • Connection strings
        • Create Oracle user (schema) for CalWin
        • Create a database link
        • Password expiration
        • Add a Directory object
        • Show table space size
        • Recovery Area Space
        • ORA-00257 - not enough space in recovery file
    • CalWin Server
      • Legg til web certificate
Powered by GitBook
On this page

Was this helpful?

  1. CalWin Script
  2. System script Events

OnModifyKickPlate

This event can be used to modify the kick plate components. The script can adjust the placement and size of the kick plates, by adjusting the deductions against frame, astragal, etc. based on, for example, the frame groove depth

Example and syntax

//This example contains many helper functions that are not included
procedure OnModifyKickPlate(aParams:TScriptOnModifyKickPlateParams);
var
  i : integer;
  vIsHingeSide : boolean;
  vLockEdgeSide:TSide;
  
  vSquare : integer;

  vDoorTypeProfile : string;
  vDoorTypeThickness : double;
  vItem:TVariantItemWrapper;

  vGrooveFrameH:integer; //height 
  vGrooveFrameD:integer; //depth    
  
  vDoorTypeHasLip:boolean;
  vDoorHasGrooveAgainstFrame:boolean;
  vLipGrooveDepth : integer;
begin  
  vSquare := aParams.Sash.Square[1];
  vGrooveFrameH := 0;
  vGrooveFrameD := 0; 
  
  for i:= 0 to aParams.Product.Variants.ItemCount - 1 do
  begin
    vItem := aParams.Product.Variants.Items[i];     
    
    if (vItem.VariantType=FrameVar) then
    begin
      vGrooveFrameH := Trunc(vItem.F1);
      vGrooveFrameD := Trunc(vItem.F2);
    end;  
    
    //store info from other variants...
  end; 
  
  vDoorTypeProfile  := GetDoortypeProfile(aParams.Product, vSquare, GetSashLevel(aParams.Sash));
  vDoorTypeThickness := GetDoortypeTykkelse(aParams.Product, vSquare, GetSashLevel(aParams.Sash));
  vDoorTypeHasLip := vDoorTypeProfile = '58L'; 
  vDoorHasGrooveAgainstFrame := (vGrooveFrameD > 0) 
    and (vGrooveFrameH > 0) and (vGrooveFrameH < vDoorTypeThickness); //Fals bare hvis falshøyde smalere enn dørbladtykkelse
  vLipGrooveDepth := 9;
  
  
  vIsHingeSide := aParams.KickPlateSide = psOutside;
  if aParams.Sash.HingeDirection = hdirLeft 
    then vLockEdgeSide := siLeft
    else vLockEdgeSide := siRight;
    
  
  //****    SINGLE DOOR ***********************************************************  
  if IsSingleDoor(aParams.Product) then
  begin 
    if (vGrooveFrameD > 0) and not vIsHingeSide then
    begin
      aParams.AdjustLeft  := 13; 
      aParams.AdjustRight := 13;
    end
    else if (vGrooveFrameD > 0) and vIsHingeSide then
    begin
      aParams.AdjustLeft  := 3; 
      aParams.AdjustRight := 3;
    end
    else //Pendulum or sliding
    begin
      aParams.AdjustLeft  := 3;
      aParams.AdjustRight := 3;
    end;
    
    if not vIsHingeSide then
    begin
      if vDoorHasGrooveAgainstFrame then //Groove only if frame groove height narrower than dooreleaf thickness
      begin
        aParams.AdjustLeft  := aParams.AdjustLeft  + 3;
        aParams.AdjustRight := aParams.AdjustRight + 3;
      end;
      
      if (vDoorHasGrooveAgainstFrame and (vGrooveFrameD > 13)) or (vGrooveFrameD >= 17) then 
      begin
        aParams.AdjustLeft  := aParams.AdjustLeft  + (vGrooveFrameD - 13); //17-13 = +4
        aParams.AdjustRight := aParams.AdjustRight + (vGrooveFrameD - 13); //17-13 = +4
      end;
      
      if vDoorTypeHasLip then
      begin //Adjust against lip on lock edge
        if vLockEdgeSide = siRight then
          aParams.AdjustRight := aParams.AdjustRight + vLipGrooveDepth
        else
          aParams.AdjustLeft  := aParams.AdjustLeft  + vLipGrooveDepth;  
      end;
    end;
  end
  
  //**** DOUBLE DOOR ***********************************************************
  else if IsDoubleDoor(aParams.Product) then
  begin
  //...
  //... 
  end;  
end;
PreviousOnModifyEdgeListNextOnModifyVariants_Final

Last updated 2 years ago

Was this helpful?