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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    SelectionTag

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 1.5k 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 12/03/2011 at 08:26, xxxxxxxx wrote:

      Is this class not finished yet ? GetSelection() does not work. And what about a SetSelection() function ?

      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 12/03/2011 at 11:21, xxxxxxxx wrote:

        Please use GetBaseSelect().

        Cheers, Sebastian

        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 12/03/2011 at 13:27, xxxxxxxx wrote:

          Ah, Is it part of the SelectionTag Class ? Its not in the Sdk.
          I'd rather need SetBaseSelect() or something.
          And something like

          MyPolygonObject.SetPolygonSelection(MyBaseSelectObject)

          Thanks, nux

          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 12/03/2011 at 14:24, xxxxxxxx wrote:

            to set the selection you can manipulate the BaseSelect which you get by calling GetBaseSelect()

            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 12/03/2011 at 17:52, xxxxxxxx wrote:

              Ah, so this is a direct link to the BaseSelect? Would never ahve thought of this
              I'll try this, thanks. 🙂

              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 12/03/2011 at 20:37, xxxxxxxx wrote:

                Here's a simple example using GetBaseSelect() just in case anyone needs it.

                  
                import c4d  
                from c4d import gui  
                  
                def main() :  
                 obj = doc.GetFirstObject()  
                 tag = obj.GetFirstTag() # make sure the selection tag is the first one in the list of tags  
                 polycountOfObject = obj.GetPolygonCount()#How many polygons does the object have in total?  
                 selected = tag.GetBaseSelect()#Gets the selected polygons on the object  
                 countSelected = selected.GetCount()#how many polygons are selected?  
                 print "total polys in object = ", polycountOfObject  
                 print "total of selected polys = ", countSelected  
                  
                #Loop through the polys to get the selected one's index numbers  
                  
                 for i in range(polycountOfObject) :  
                  if selected.IsSelected(i) :  
                print i  
                  
                if __name__=='__main__':  
                  main()  
                

                -ScottA

                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 13/03/2011 at 05:50, xxxxxxxx wrote:

                  Btw, you don't need to declare i before the for-loop.
                  And it was about setting selection, not getting. 😉

                  Works perfect, Satara ! But i'd rather use SetSelection(BaseSelectObject). Unfortunately it's not possible

                  Cheers, nux

                  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 13/03/2011 at 07:48, xxxxxxxx wrote:

                    The methods BaseSelect.CopyTo and BaseSelect.GetClone might help you here.

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