UI Functions

These functions are used to manage the user interface.

Notes: The ReframeOn, FitAllIn, CenterGraph and AddToSelection functions are asynchronous; they are effective when the application is refreshed, not during the rule execution.

Multiple calls to ReframeOn, FitAllIn or CenterGraph can lead to unpredictable behavior as, for example, one call to CenterGraph can be overruled by another.

AddToSection can be called multiple times within a rule. The first call erases the current selection, the subsequent ones add elements to the selection unless the argument iEmptyCurrentSelection is set. Calling AddToSelection from different rules may lead to unpredictable behavior, only the last rule is taken into account.

This page discusses:

AddToSelection

Used to add an item to the selection.

Signature

AddToSelection(iToAddToSelection : ObjectType, iEmptyCurrentSelection : Boolean)

Arguments

NameInput/OutputRequired?TypeComment
iToAddToSelectionInYesObjectTypeItem to add. It can be a feature or a path generated using the CreatePathString method.
iEmptyCurrentSelectionInYesBooleanUsed to empty the current selection before creating a new one.

CenterGraph

Used to center the graph in the active tab.

Signature

CenterGraph(iFeatToCenterOn : ObjectType)

Arguments

NameInput/OutputRequired?TypeComment
iFeatToCenterOnInYesObjectTypeIt can be a feature or a path generated using the CreatePathString method.

CreateProgressBar

Used to create the progress bar and attach it to the context. If called multiple times, the existing progress bar attached to the context will appear. In case of reusable functions, the same progress bar is used and updated by all the executed scripts.

Signature

CreateProgressBar()

FitAllIn

Function used to reframe the entire object so that it fits in the viewer.

Signature

FitAllIn()

ProgressBarNextStep

Used to increase the current step. Passing from one step to the next launches the computation of the progress value.

Signature

ProgressBarNextStep()

ReframeOn

Used to reframe the model.

Signature

ReframeOn(iFeatToReframeOn : ObjectType)

Arguments

NameInput/OutputRequired?TypeComment
iFeatToReframeOnInYesObjectTypeIt can be a feature or a path generated using the CreatePathString method.

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 again later, the weight of the following steps will be updated according to the completed steps and the progress value.

Signature

SetMaxStep(maxStep : Integer)

Arguments

NameInput/OutputRequired?TypeComment
maxStepInInteger-

ProgressBarSetNextValue

Used to set the next maximum value. It is useful for reusable functions. In the reusable function, the progress value will be limited by the value set using this method. Using this method reinitializes the prospective information about steps that could have been calculated by the previous methods.

Signature

SetNextValue(nextValue : Real)

Arguments

NameInput/OutputRequired?TypeComment
nextValueInReal-

ProgressBarSetValue

Used to directly set the progress value. Using this method reinitializes the prospective information related to the current step and the maximum number of steps.

Signature

SetValue(value : Real)

Arguments

NameInput/OutputRequired?TypeComment
valueInReal-

ProgressBarSetText

Used to set information (text) on the progress bar.

Signature

SetValue(value : Real)

Arguments

NameInput/OutputRequired?TypeComment
valueInReal-

ShowHelp

Function used to look for a URL or a document in an ARM table and to open the document or the URL when called.

Signature

ShowHelp(iRMPathOrURL : String)

Arguments

NameInput/OutputRequired?TypeComment
iRMPathOrURLInYesStringIt must be an ARM path or a URL.

AddTextSymbol

Function that lets you display text in a 3D viewer. The text is linked by an arrow to an object which is under the viewer root. If you do not specify the optional iViewer argument, this function is applied to the main viewer.

Important: This function must be applied on an interieur feature. It does not function properly on bodies or geometrical sets.

Signature

AddTextSymbol(iText : String, iAnchorObject : ObjectType [, iViewer : ObjectType])

Arguments

NameInput/OutputRequired?TypeComment
iTextInYesString
iAnchorObjectInYesObjectType
iViewerInNoObjectType

Example

let fret(Feature)

for fret inside FretsList 
{
    if(fret.HasAttribute("Name_Icon"))
    {
        if(fret.GetAttributeString("Name_Icon")=="DoubleIndicator")
        {
            // Add the text "Double", anchored to fret, in the knowledge dialog viewer "Viewer3D1"
            AddTextSymbol("Double",fret,Viewer3D1 )
            // Add the text "Double", anchored to fret, in the main viewer
            AddTextSymbol("Double",fret)
        }
        if(fret.GetAttributeString("Name_Icon")=="SimpleIndicator")
        {
            // Add the text "Simple", anchored to fret, in the knowledge dialog viewer "Viewer3D1"
            AddTextSymbol("Simple",fret,Viewer3D1 )
            // Add the text "Simple", anchored to fret, in the main viewer
            AddTextSymbol("Simple",fret)
        }
    }
}

RemoveAllSymbol

Function that removes all previously added text symbols using the AddTextSymbol function in the specified viewer. If you do not specify the optional iViewer argument, this function is applied to the main viewer.

Signature

RemoveAllSymbol([iViewer : ObjectType])

Arguments

NameInput/OutputRequired?TypeComment
iViewerInNoObjectType-

Example

// remove text symbols from the knowledge dialog viewer "Viewer3D1"
RemoveAllSymbol(Viewer3D1)

//remove text symbols from the main viewer
RemoveAllSymbol()