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
    1. Maxon Developers Forum
    2. Tennet
    3. Posts
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by Tennet

    • RE: Python script for Rectangle Selection with options

      Hi Manuel and @rb_rodrigo,

      Many thanks for the tips about the Python console and help with the code. I'm a beginner (not even that!) in scripting, so much appreciated. It works as expected now!

      Cheers,
      Frederik

      posted in General Talk
      T
      Tennet
    • Python script for Rectangle Selection with options

      Hi! I've tried to create a simple Python-script for switching to selections tools using my own "personal" selection settings.. but it doesn't work as I want it to.

      For example, when I select the 'Rectangle selection' tool, then I want "Tolerant Selection" to be checked by default. And 'Only Select visible' should be off.. but it doesn't work. The script doesn't change these settings if they are set to something else before.

      My script looks like this (below). Would really appreciate if someone could help me with the correct code for this (I don't understand programming, I only copy and paste the code from the Script Log..). Or point me in a direction where I can learn it. Many thanks! 🙂

      import c4d
      from c4d import documents, plugins
      #Welcome to the world of Python
      
      def main():
      
          c4d.CallCommand(12139) # Points
          c4d.CallCommand(200000084) # Rectangle Selection
          tool()[c4d.MDATA_SELECTION_TOLERANCE] = True
          tool()[c4d.MDATA_SELECTION_VISIBLE] = False
      
      
      if __name__=='__main__':
          main()
          c4d.EventAdd()()
      
      posted in General Talk
      T
      Tennet