THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/10/2004 at 01:07, xxxxxxxx wrote:
Cinema 4D Version: 7.303
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
I have created a PolygonSelectionTag and assigned a polygon using the following COFFEE code:
newbs = new(BaseSelect);
tag = new(PolygonSelectionTag);
And now I want to get back the polygon number which has been assigned to the PolygonSelectionTag. I am trying like this...
var objTag = obj->GetFirstTag();
if(objTag->GetType()==5673) // ****** IF POLYGONSELECTION TAG
// ***** HERE I WANT TO GET THE POLYGON NUMBER
Hope someone will help me...
On 05/10/2004 at 00:53, xxxxxxxx wrote:
The BaseSelect class doesn't contain the list of selected indices. Instead it works with bit arrays to mark every selected index, so you have to check every polygon in your object using a code like this:
var sel = objTag->GetSelection();
var i = 0;
for (i = 0; i < obj->GetPolygonCount(); i++)
if (sel->IsSelected(i)) println(i);
// obj->GetPolygon(i) is selected
Hope it helps...
On 05/10/2004 at 02:31, xxxxxxxx wrote:
Thanks for the response. I have already tried this. It works fine. Let me explain my problem in detail.
At first I created a Selection Tag for polygon No 4. After that I knife the polygon, it becomes as two polygons... probably polygon no 4 & 9. In design view in object manager when i double click my selection tag and click "Select Polygons" it will select both 4 & 9. But I tried with the above source code, it selects only 4. Its not detecting 9 (as selected polygon). Which function to use to achieve this?
On 06/10/2004 at 01:06, xxxxxxxx wrote:
I got it. I made a small mistake. Its working now.