The only way I see how to use MPolygon is:
1: Get the bounding of the text object
2: Create 4 points (3d) from the points returned by step 1
3: Create 4 Vetex2d from the points in step 2
4: Create a Polyline2d from the vertexes in step 3 (not sure how yet since it wants ObjectId's to add a vertex, but I assume when you create a vertex it will create an ObjectId even if it isn't added to the database)
5: Create an MPolygon from the polyline in step 4
6: Repeat steps 1 and 2 while testing to see if they are inside of the MPolygon returned in step 5
Is this the correct way? Or is there a shorter more concise method I'm missing? Or an understanding I'm not understanding?
Thanks.
Tim;
I have done something similar in ObjectARX, if I had a chance today, I will try to write something -
This is in general what I do:
- Make a selection set of using a filter for Mtext/Text
- On each item make a crossing selection set again using a filter for Mtext/text - and before removing the item, so is not get selected in this new one. (many times I use the bounding box, but I calculate an smaller diagonal using both corner points - just to make sure only object that are in the area are selected)
- If there is a selection, then grab the two corner bounding points and use the point inside function, to test if they are inside of the main bounding box that you can have in ObjectARX as a temporary - without even needed to be drawn on the data base - I guess this can be done also in C#)
- If both points pass the test, then I can do something with that object.
It is making any sense?