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

    Posts made by bureaudesprojets

    • RE: Python Generator and texte

      Hello,

      Thanks a lot for your help !

      posted in Cinema 4D SDK
      B
      bureaudesprojets
    • Python Generator and texte

      Hello there,

      for the plugin i'm working on, I need to generate an aeronautical numerotations. Meaning it goes like A, B , C... Z, AA, AB , AC
      Capture d’écran 2022-01-14 à 11.19.56.png
      I made a code wich I fill with the number of letters I want and the distance I want between each letters.

      import c4d
      
      
      
      def main():
      
          number= op [c4d.ID_USERDATA,3]
          distance = op [c4d.ID_USERDATA,4]
          alphabet=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] ;
      
          for x in range( number):
      
              if ((x//26)-1==-1) :
                  null = c4d.BaseObject ( c4d.Onull)
                  texte = c4d.BaseObject(1019268)
                  texte[c4d.PRIM_TEXT_TEXT]= alphabet [x]
                  print (alphabet [x])
                  texte.InsertUnder ( null)
              else :
                  null = c4d.BaseObject ( c4d.Onull)
                  texte = c4d.BaseObject(1019268)
                  texte[c4d.PRIM_TEXT_TEXT]= alphabet [(x//26 - 1)]; alphabet [x%26]
                  print (alphabet [x//26 - 1], alphabet [x%26])
                  texte.InsertUnder ( null)
          texte[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Z] = x* distance
      
      
      
          return null
      

      This is the result of my programs. I have the right letters but it display only the letters corrrespodings to the number not all letter before. Like in the picture above.

      Capture d’écran 2022-01-14 à 11.29.41.png

      I hope my issue is clear

      Thanks a lot

      Nadja

      posted in Cinema 4D SDK python r25
      B
      bureaudesprojets