Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    PolygonSelectionTag

    SDK Help
    0
    4
    290
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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:

      User Information:
      Cinema 4D Version:   7.303 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,
      I have created a PolygonSelectionTag and assigned a polygon using the following COFFEE code:

          
          
          
          
                 newbs = new(BaseSelect);  
                 newbs->Select(5);  
                 tag = new(PolygonSelectionTag);  
                 tag->SetSelection(newbs);  
                 tag->SetName("Testing");  
                 ObjBeam->InsertTag(tag);
          
          
          
      

      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)  
           {  
            if(objTag->GetType()==5673) // ****** IF POLYGONSELECTION TAG  
            {  
             println(objTag->GetName());  
             // ***** HERE I WANT TO GET THE POLYGON NUMBER 
          
          
          
      

      Hope someone will help me...

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        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...

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          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?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 06/10/2004 at 01:06, xxxxxxxx wrote:

            Hi Guys,
            I got it.  I made a small mistake. Its working now.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post