I built an IPointCollection and can display it, but I would like to display multiple copies in different locations. Is there a way to center a point collection on another IPoint?

2 Answers 2


Would ITransform2D (or 3D) work for you?


You can use whatever point you wanted to in the original point collection (centroid, endpoints, midpoints) and calculate the dx and dy needed to move. Or just construct an line from the two points and use MoveVector.


You're gonna have to modify the coordinates of each point.
You can write a method that accepts an IPointCollection, an IPoint and produces a shifted IPointCollection which would be the original IPointCollection but with all the coordinates shifted.
Doing this in a separate method is important to avoid accidentally modifying the original IPointCollection.
The tricky part is how to shift the points. You can assume that you'll make the first point in the IPointCollection be the IPoint passed to the method and apply the same shift to all the other points.
There are other options, like assuming that the input IPoint would be the new center of the IPointCollection. Do this by calculating the centroid of the IPointCollection and calculating the shift between it and the input IPoint then applying this shift to all the other points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.