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. OllyFJ
    3. Posts
    O
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by OllyFJ

    • RE: python combobox get current value

      @zipit Thanks mate, that's done it!

      posted in Cinema 4D SDK
      O
      OllyFJ
    • python combobox get current value

      Hey, fairly basic question but I'm pretty new to this and struggling to solve it, I'm trying to write a save script in python, I've filled a combo box with a list of directories, I need to access the string of the currently selected value to link to a second combobox to search for the next folder in the chain, how would I go about doing this? in Houdini I have the same tool working using 'self.ui.jobID.currentText() ' is there a similar function in c4d?

       self.AddComboBox(J_NAME, c4d.BFH_SCALEFIT, initw=300, inith=10)
       self.AddChild(J_NAME,0,'______') 
              self.jobs = 'C:/Users/Olly/Downloads/'
              if os.path.isdir(self.jobs):
              
                  # add only directories to list
                  i = 0
                  dirlist = next(os.walk(self.jobs))[1]
                  dirlist.sort()
                  for d in dirlist:
                      
                      if os.path.isdir(self.jobs+d):
                          i += 1                   
                          self.AddChild(J_NAME, i, d)
      

      Thanks!

      posted in Cinema 4D SDK r21 r20 r19 python
      O
      OllyFJ