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
    Project myProject = m_oProject; // A valid project
    Page myPage = myProject.Pages[0]; // A valid Page object
    
    // Define test property
    MultiLangString mlsTestValue = new MultiLangString();
    mlsTestValue.AddString(ISOCode.Language.L_de_DE, "Test043c");
    string strPropertyIdentyfingName = "Page.Test043c";
    UserDefinedPropertyDefinition oUDPD = UserDefinedPropertyDefinition.Create(myProject, strPropertyIdentyfingName, UserDefinedPropertyDefinition.Enums.ClientType.Page);
    
    // Set test property on myPage
    myPage.Properties[strPropertyIdentyfingName] = mlsTestValue;
    
    // Search page with property value
    DMObjectsFinder objFinder = new DMObjectsFinder(myProject);
    PagesFilter pagesFilter = new PagesFilter();
    PagePropertyList pagePropertyList = new PagePropertyList();
    AnyPropertyId anyPropertyId = new AnyPropertyId(myProject, strPropertyIdentyfingName);
    
    pagePropertyList[anyPropertyId] = mlsTestValue;
    pagesFilter.SetFilteredPropertyList(pagePropertyList);
    Page[] arrPages1 = objFinder.GetPages(pagesFilter);
    
    
    
    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