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

    Get value of chosen Combobox/Dropdown in Layout

    Scheduled Pinned Locked Moved PYTHON Development
    5 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

      On 12/08/2018 at 22:03, xxxxxxxx wrote:

      How can I get the value(string) from a combobox dropdown in a layout window?

      I can use GetLong to get the subID, but the string and the subId are both created dynamically.

      for example if I added the child
      self.AddChild(1001,10011,"Circle")
      I can get 10011 with self.GetLong(1001)
      How would I get "Circle" if I knew the (10011)?

      Thank you.

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

        On 13/08/2018 at 02:25, xxxxxxxx wrote:

        Hi,

        welcome to the Plugin Café forums 🙂

        No, in a GeDialog there's no easy way to get the strings stored in a combobox. Instead I'd do it the other way round. Create a dictionary containing the IDs and strings. Then fill the combobox from this dictionary and when reading the value use the dictionary to look up the string by its ID.

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

          On 13/08/2018 at 07:06, xxxxxxxx wrote:

          Ok. That makes sense. Thanks

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

            On 13/08/2018 at 07:16, xxxxxxxx wrote:

            Is there a good place to learn about python with C4D besides the documentation, which I find a bit confusing.

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

              On 13/08/2018 at 07:21, xxxxxxxx wrote:

              Well, usually I recommend the examples coming with the Python SDK documentation.
              On our development blog we once collected a bunch of resources, see post Public Resources for Cinema 4D Plugin Development in Python[URL-REMOVED]


              [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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