Step Mode
This mode lets you manage the progress bar through a number of steps. The progression is managed step by step.
Dedicated Methods
ProgressBarSetMaxStep
: Used to set the maximal number of steps in the script. Based on the number of steps, the weight of each step can be computed for the current script. If this method is called later, the weight of the following steps will be updated according to the steps already completed and the progress value.ProgressBarNextStep
: Used to increase the current step. Passing from one step to the following one launches the computation of the progress value.
Example
// ------------------------------------------------------- // This EKL script instantiates user features between two points // ------------------------------------------------------- Notify("KPCreateBeads") let udf (userfeature) // user feature let pt1 (point) // first input of user feature let pt2 (point) // second input of user feature // previously created list of points stored in another knowledge pattern let pointsList (List) pointsList = Relations\KPCreatePoints\PointsList // ***************************** // ProgressBar creation // ***************************** CreateProgressBar("ProgressBar Name") let i (integer) i = 1 let nbPts(Integer) nbPts = pointsList.Size() // ***************************** // ProgressBar : Step Mode // ***************************** ProgressBarSetMaxStep(nbPts-1) for i while i <= nbPts-1 { // user feature creation // CreateOrModifyTemplate arguments: // - name of user feature in Resource Table // - destination // - knowledge pattern list // - index udf = CreateOrModifyTemplate("UDFBead", CreatedUDFs, Relations\KPCreateBeads\UDFBeadList, i) // user feature inputs pt1 = pointsList.GetItem(i) pt2 = pointsList.GetItem(i+1) // SetAttributeObject arguments: // - input name (be careful if you renamed it in user feature) // -feature udf.SetAttributeObject("StartPoint", pt1) udf.SetAttributeObject("EndPoint", pt2) // user feature end EndModifyTemplate(udf) // just for fun, adding color to created user features let maxi (integer) maxi = 255 let str1, str2, str3, str4 (string) str1 = ToString(floor(Rand()*maxi)) str2 = ToString(floor(Rand()*maxi)) str3 = ToString(floor(Rand()*maxi)) str4 = str1 + "," + str2 + "," + str3 udf.Color = str4 // ***************************** // ProgressBar : Step Mode // ***************************** ProgressBarNextStep() }