Eplan Platform API
Eplan.EplApi.DataModel Namespace / ConnectionsFilter Class
Members Example

In This Topic
    ConnectionsFilter Class
    In This Topic
    This class represents filter for Connection class. The ConnectionsFilter can be used as a parameter for Eplan::EplApi::DataModel::DMObjectsFinder: method. Setting more than one criterion of matching the filter, causes that returned connections must match those conditions.
    Inheritance Hierarchy

    System.Object
       Eplan.EplApi.DataModel.AbstractDMObjectFilter
          Eplan.EplApi.DataModel.ConnectionsFilter

    Syntax
    public class ConnectionsFilter : AbstractDMObjectFilter 
    public ref class ConnectionsFilter : public AbstractDMObjectFilter 
    Example
    //(...)
    DMObjectsFinder oFinder = new DMObjectsFinder(m_oProject);
    FunctionsFilter oFuncFilter = new FunctionsFilter();
    string strStartFunctionName = "=AP+ST1-XTR";
    oFuncFilter.Name = strStartFunctionName;
    Function[] arrFuncs = oFinder.GetFunctions(oFuncFilter);
    //Assert.IsTrue(arrFuncs.Length > 0, ShowMessage("Could not find function with name: {0} !"), strStartFunctionName);
    Function oStartFunc = arrFuncs[0];
    //Assert.AreEqual(strStartFunctionName, oStartFunc.Name, ShowMessage("Failed to get proper function !"));
    //now find connection for that function
    ConnectionsFilter oFilter = new ConnectionsFilter();
    oFilter.Function = oStartFunc; //is it start function or end function, does it occur with both ?
    //get connections
    Connection[] arrConnections = oFinder.GetConnections(oFilter);
    //(...)
    The following example shows how to filter by user-defined properties
    MultiLangString mlsTestValue = new MultiLangString();
    mlsTestValue.AddString(ISOCode.Language.L_de_DE, "Test043c");
    string strPropertyIdentyfingName = "Page.Test043c";
    UserDefinedPropertyDefinition oUDPD = UserDefinedPropertyDefinition.Create(m_oProject, strPropertyIdentyfingName, UserDefinedPropertyDefinition.Enums.ClientType.Page);
    
    //set test property
    Page oPage = m_oProject.Pages[0];
    oPage.Properties[strPropertyIdentyfingName] = mlsTestValue;
    
    //search page with property value
    DMObjectsFinder oFinder = new DMObjectsFinder(m_oProject);
    PagesFilter oPagesFilter = new PagesFilter();
    PagePropertyList oPagePropertyList = new PagePropertyList();
    AnyPropertyId oAnyPropertyId = new AnyPropertyId(m_oProject, strPropertyIdentyfingName);
    oPagePropertyList[oAnyPropertyId] = mlsTestValue;
    oPagesFilter.SetFilteredPropertyList(oPagePropertyList);
    Page[] arrPages1 = oFinder.GetPages(oPagesFilter);
    
    
    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public PropertySets the Function that Connections matching the filter must have as the start or the end function.  
    Top
    Public Methods
     NameDescription
    Public MethodDestructor for deterministic finalization of ConnectionsFilter object. (Inherited from Eplan.EplApi.DataModel.AbstractDMObjectFilter)
    Public MethodOverridden. Resets the filter. Filter matches all Connections then.  
    Public MethodSets the ConnectionPropertyList that Connections matching the filter must have.  
    Top
    See Also