EBSILON®Professional Online Documentation
The Graphical Editor / Filters / Filters activated by EbsScript Function
In This Topic
    Filters activated by EbsScript Function
    In This Topic

    Filters activated by EbsScript Function


    Filters always had to be compiled of layers. The definition of the filter entailed determining for each layer in which way it was to be represented and hidden, respectively.

    Alternatively it is possible to directly define the visibility for each object through an  EbsScript function. In this case no layers are needed.

    In the filter definition, the name of the EbsScript function to be activated is to be entered. This way, even several filters with different EbsScript functions can be defined. The EbsScript function has to be contained in an EbsScript defined as a standard unit.

    The syntax of the EbsScript function has to be structured as follows:

    function name (obj: ebsobject): objectdisplay;

     

    Example:

    Filter for displaying all components dimmed, but active measured values are displayed coloured:

     

    unit StandardUnit;
    
    interface
    function Comp46UsedInSimulation(obj:ebsobject):objectdisplay;

    implementation
    function Comp46UsedInSimulation(obj:ebsobject):objectdisplay;
    var
    disp : objectdisplay;
    comp46 : ebscomp46;
    begin
    comp46 := ebscomp46(obj);
          disp.state := drawModeGrayed;
    disp.patternBitmap := patternBitmapNONE;

    if not isnull(comp46) then begin
    if (comp46.FFU = 1 AND comp46.FVAL = 2) then begin
    disp.state := drawModeColor;
    disp.patternBitmap := patternBitmapNONE;
    end;
    end;

    Comp46UsedInSimulation := disp;
    end;
    end.