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.
//(...)
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);