WhoCanDo Posted July 15, 2010 Share Posted July 15, 2010 Hi, I want to find what objects are within a 2D polygon region. Currently I pick a polygon and duplicate it with h2=MakePolygon(h) then name it with SetName(h2,'tmp'). After this I will: ForEachObject (Check_for_X,((Loc = 'Tmp') & (T = X))); if (h2 <> Nil) then DelObject(h2); This works well but when I have two polygons grouped that represent the final product I can't use MakePolygon. Any suggestions on how to create a tmp polygon profiling the perimeter of the final product? Quote Link to comment
MullinRJ Posted July 15, 2010 Share Posted July 15, 2010 Hi Who, You can get the handle of the 1st object in a group with: ???h2a := FinGroup(GrpHand); and get a handle to the next object in the group with: ???h2b := NextObj(h2a); If they happen to be Polys, so much the better. OR, you can duplicate the group with: ???Grouplic8Hand := hDuplicate(GrpHand, 0, 0); OR, move pieces into a Group with: ???boo := SetParent(h2, GrpHand); or out of a Group with: ???boo := SetParent(h2, GetParent(GrpHand)); If you want to merge the two polys in your group into one (assuming they overlap), you might use: ???h3 := AddSurface(h2a, h2b); and then ungroup it with: ???hUngroup(GrpHand); I'm not sure which approach, if any, would work for you. I'll let you pick. Have fun, Raymond Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.