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

OnModifyEdgeList

This event can be used to modify the veneer strips (edge lists) for a sash. The script can determine the search value for veneer strip(edgelist) search, and it can "turn off" veneer strips on selected sided of the sash.

Example and syntax

//Dummy helper function for the sake of the examples simplicity
function GetSashElementAdjacent(aElement:TCustomElementWrapper): TCustomElementWrapper;
begin 
  Result := nil; 
end;

//Dummy helper function for the sake of the examples simplicity
function NeedsExtraWidthEdgeList(aParams:TScriptOnModifyEdgeListParams) : boolean;
begin
  Result := False;
end;

//Subprocedure for modifying the search value
procedure ModifyEdgeList_SearchValue(aParams:TScriptOnModifyEdgeListParams);
var 
  vEdgeListItem : TVariantItemWrapper;
begin   
  vEdgeListItem := aParams.EdgeListVariantItem;
  if (vEdgeListItem.S1 = 'TYPE A') or (vEdgeListItem.S1 = 'TYPE C') then
  begin        
    if NeedsExtraWidthEdgeList(aParams) then //Helper function that needs to be defined
      aParams.EdgeListSearchValue := aParams.EdgeListSearchValue + 'W';
  end;
end;

//Subprocedure for modifying the disabled property
procedure ModifyEdgeList_Disabled(aParams:TScriptOnModifyEdgeListParams);
var
  vAdjacentBottom: TCustomElementWrapper; 
begin
  {Fixed sashes above a transom should only have edgelist if edge is visible.
  The edge is only visible on the bottom of the sash and only if placed above a "dummy" transom.
  For simplicity in this script example, the sashes above a transom are always 
  considered "fixed" and cannot be opened}
  vAdjacentBottom := GetSashElementAdjacent(aParams.Sash.BottomElement);
  if assigned(vAdjacentBottom) and (vAdjacentBottom.ElementKind=ekTransom) then
  begin
    if vAdjacentBottom.S1='DUMMY' then
      aParams.EdgeListDisabled := aParams.SashElement.OctagonPos <> ocBottom
    else
      aParams.EdgeListDisabled := True;   
  end; 
end;

//This is the actual script event being called by CalWin
procedure OnModifyEdgeList(aParams:TScriptOnModifyEdgeListParams);
begin
  {Here I have chosen to split the code in two subprocedures based on what it modifies, 
  to keep the code cleaner, like the original real code was. 
  The original code was much more complex than this example}
  ModifyEdgeList_SearchValue(aParams);
  ModifyEdgeList_Disabled(aParams); 
end;
PreviousOnIsSpecialProductNextOnModifyKickPlate

Last updated 2 years ago

Was this helpful?