Jump to content
Developer Wiki and Function Reference Links ×

MakePolygon not working for groups


Recommended Posts

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?

Link to comment

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...