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
  • Example and syntax
  • Note

Was this helpful?

  1. CalWin Script
  2. System script Events

OnSetElementJointType

Script for manipulating the joints of a product. This overrides the "End type" values set in the component table.

The script is called one time for each "set of components" for all "sets" (frame, sash, glazing bead, packers etc).

Example and syntax

procedure OnSetElementJointType(aParams:TScriptOnSetElementJointTypeParams);
var
  I : Integer;
  vJoint : TJointWrapper;
begin
  //Loop through all the joints and modify the ones that needs modification
  for I := 0 to aParams.JointCount - 1 do
  begin
    vJoint := aParams.Joints[I]; 

    //Top Ridge /\
    if (vJoint.LeftElement.OctagonPos = ocTopLeft) and (vJoint.RightElement.OctagonPos = ocTopRight) then 
    begin
      if (vJoint.Angle > 90) 
        then vJoint.JointType := jtMitre
        else vJoint.JointType := jtCounterProfileTenonRight; //Either right or left. Which one is the "Tenon" probably doesn't matter in this case
    end;

    //...other Joints... 
  end;
end;

Note

To know which option type the script is currently called for use "aParams.CustomSet.VariantType".

NB! Please note that for glazing beads "aParams.CustomSet.VariantItem" could be nil, as there can be glazing beads without a glazing bead option present. aParams.CustomSet.VariantType will still return the correct option type (GlazingBeadVar).

To know the length of the sides in the join use aParams.CustomSet.OuterOutline.Lines. For instance aParams.CustomSet.OuterOutline.Lines[vJoint.LeftElement.OctagonPos].Length. DO NOT USE vJoint.LeftElement.Length or vJoint.RightElement.Length. The reason for this is that the calculation of the elements length depends on the joint type which is not yet to be determined (by the script).

PreviousOnSalesheaderPriceFinalizationNextOnSetSileDividersPos

Last updated 2 years ago

Was this helpful?