View Full Version : select polygons by id

06-27-2004, 07:45 AM
hello all, what is the way to select polygons by their ids, all what i want is :
i have 6 polygons in layer 1, i want to select poly2 to poly6 cut it and paste into layer 2, now in layer 2 select poly2 to poly5 and hide, so the poly1 is active and poly2 to poly5 are hidden, then after this step i want to unhide all, select poly2 unhide unselected, so now poly2 is active.......and like this to terminate the loop.
anysuggestions plz.
thanks in advcance.

06-28-2004, 01:11 PM
Hmm don't know what you want.

Search the docs for


there is a code snip

selmode(USER); // user selection, if nothing -> all
selpolygon(CLEAR); // clear poly selection
selpolygon(SET, POINTNDX, 1); // select first poly

06-28-2004, 09:52 PM
If you want to select a point or polygon by their id (unique 8 digit numbers) you first have to go through a session of MeshdataEdit (enter and exit) to create an array containing ids. Either use the ones created automatically when entering ME mode (called points and polygons) or create your own from those. Then use selpolygon(SET, POLYID, [Name of array containing IDs]) to select.

However it almost sounds like what you want to use is indexes (based on order of selection or creation), as wiffzack seems to have noted as well. Personally I don't get what you want to accomplish by this script. If you unhide all at one time, then any action to hide specific polygons prior to that will go unnoticed.