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

    How to obtain the selection order of objects in C++

    Cinema 4D SDK
    s26 c++ macos windows
    3
    4
    725
    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.
    • P
      pchg
      last edited by

      I used C++ to write the C4D S26 plugin on Windows 10, I want to get the order in which BaseObject are selected by the user, User selections can be unordered, I want to know the order in which he was selected.
      Thanks in advance!
      444.png

      1 Reply Last reply Reply Quote 0
      • S
        spedler
        last edited by

        Would BaseDocument::GetActiveObjects() and the GETACTIVEOBJECTFLAGS::SELECTIONORDER flag do the trick?

        Steve

        P 1 Reply Last reply Reply Quote 0
        • i_mazlovI
          i_mazlov
          last edited by

          Hi @pchg ,

          @spedler thank you for providing the answer. You should actually give the aforementioned GetActiveObjects() function with the SELECTIONORDER flag a try.

          You should be careful with this function though, when selecting hierarchies, as this could lead to some not completely expected results.

          Cheers,
          Ilia

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 0
          • P
            pchg @spedler
            last edited by

            @spedler Thank you for your help

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