let udf (PktBox) let prev (PktBox) let p (Plane) let i (Integer) i = 1 For i while i <= NbInstances { udf = CreateOrModifyTemplate("PktARMcatalog2|BoxUDF", PartBody, `Relations\Knowledge Pattern.1\Boxes` , i) if i == 1 udf.BoxInputPlane = FirstBoxPlane else { prev = `Relations\Knowledge Pattern.1\Boxes`.GetItem(i - 1) udf.BoxInputPlane = prev.NextBoxInputPlane udf.PreviousBoxLength = prev.L } udf.SketchPlane = SketchPlane EndModifyTemplate(udf) udf.Name = "Box" + ToString(i) i = i +1 }