I am using AFAttribute.FindElementAttributes Method to get the immediate attributes under an Element. I am seemingly also getting the AFAttributes under the first children elements, event though I have set searchFullHierarchy to false.
var pointAttributes = AFAttribute.FindElementAttributes(element.Database, element, "", "", null, null, AFElementType.Any, "", "", null, TypeCode.Double, false, AFSortField.Name, AFSortOrder.Descending, 0, int.MaxValue, out totalFound);
For the string searchFilters I have used an empty string, as the documentation says that it should match all. I have also tried null and "*" with the same result.
My test AFDB has three levels.
Elem1 ( Attribute1)
- Elem2 (Attribute2)
- Elem3 (Attribute3)
- Elem4 (Attribute4)
With the searchRoot set to Elem1:
If I set searchFullHiearchy to false, I get Attribute1,Attribute2 and Attribute3.
If I set it to true, I get all 4.
AFServer either 18.104.22.16866 or 22.214.171.1244
I would like to only return Attribute1.
What should the correct parameters be?
I'd also like to only return PIPoint attributes by changing AFElementType.Any for AFElementType.PIPoint. I would assume this search will be faster than iterating the element.Attributes ?