Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Get Point Selection?

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 414 Views
    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 Offline
      Helper
      last edited by

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

      On 26/12/2008 at 15:12, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.1 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      Hi,

      I want to get the selected points from a point selection tag attached to a polygon object. I see there is a SelectionTag, and I can get a BaseSelect from it, but I don't quite understand how to get to the selected points.

      Is there any example code?

      Greetings & Thanks in advance,
      Jack

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

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

        On 26/12/2008 at 18:04, xxxxxxxx wrote:

        Point and Polygon selections work identically. They contain the same number of elements as the PointCount and PolyCount of the object and the value at the index is 1 if selected, 0 if not (via IsSelected()). Or you just use the segments (which only return groups of selected elements). So, to get the selected points, you will need the point Vector array (GetPoint()) and the Point selection tag's BaseSelect in unison.

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

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

          On 27/12/2008 at 02:04, xxxxxxxx wrote:

          Ah, OK. That sounds easy 🙂
          Thanks Robert!

          Greetings,
          Jack

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

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

            On 27/12/2008 at 12:33, xxxxxxxx wrote:

            Like so:

                
                
                  
                    LONG ndx, seg = 0, smin, smax;  
                    Vector *pPoints = pPolyObj->GetPointW();  
                    BaseSelect *pBaseSelect = pPolyObj->GetPointS();  
                    while( pBaseSelect->GetRange(seg++,&smin,&smax) )  
                    {  
                        for( ndx=smin; ndx<=smax; ndx++ )  
                        {  
                            GePrint("Point: "+LongToString(ndx)+" is selected");  
                        }  
                    }
                
                
                
            

            ... that itterates over the segments.

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

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

              On 28/12/2008 at 08:41, xxxxxxxx wrote:

              That gets the actively selected points on the object but to get the selection in a selection tag, it is slightly different (thankfully, one doesn't need to use SendModelingCommand() in a circuitous way) :

              > Vector\* pPoints = pPolyObj->GetPointW(); \> if (!pPoints) //... \> BaseSelect\* pSelect = pSTag->GetBaseSelect(); \> if (!pSelect) // ... \> LONG a, b, c; \> for (LONG seg = 0L; pSelect->GetRange(seg,&a;,&b;); ++seg) \> { \>      for (c = a; c <= b; ++c) \>      { \>           GePrint("Point selected: "+LongToString(c)); \>      } \> } \>

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