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

    SelectAll Doc example max range

    Scheduled Pinned Locked Moved Bugs
    2 Posts 0 Posters 699 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

      On 19/08/2017 at 06:56, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :       PYTHON  ;

      ---------
      Hello,

      About the SelectAll() method of the BaseSelect class, the "max" value is "the last element in the range to select".

      So to select all polygons, for example, it will logically be :

      SelectAll(op.GetPolygonCount() - 1)
      

      But in the Python documentation, the example for the edges show :

      edges.SelectAll(nbr.GetEdgeCount()) # Select all edges in the range [0, nbr.GetEdgeCount()]
      

      Is it not nbr.GetEdgeCount() - 1, instead ?

      https://developers.maxon.net/docs/py/2023_2/modules/c4d/BaseSelect/index.html?highlight=selectall#BaseSelect.SelectAll

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

        On 21/08/2017 at 03:23, xxxxxxxx wrote:

        Hi,

        You are right. The code snippet for BaseSelect.SelectAll() should pass nbr.GetEdgeCount()-1 instead of just nbr.GetEdgeCount(). The parameters max and min as refer to an element index.
        This issue in the example will be fixed.

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