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;

Last updated

Was this helpful?