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).
Last updated
Was this helpful?