Please read the guidelines: Read before posting: How do I get my question answered?
To me it is unclear what you mean by “making a boundary”. Do you mean you would like to mark facets of a set of elements based on the value of the centroid of the element?
Please post a minimal working example as illustrated in the subsequent post in the thread I link to above.