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

    Set starting folder [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 459 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 21/02/2016 at 03:22, xxxxxxxx wrote:

      I know two ways to search for a folder, but I do not how to set the folder where to start the search.
      For example, search for a folder in c:/temp?

      Both ways do not start with c:/temp

          path = c4d.storage.LoadDialog(c4d.FILESELECTTYPE_ANYTHING, 
              "Please choose a folder", c4d.FILESELECT_DIRECTORY, "", "c:/temp")
      
              settings = c4d.BaseContainer() 
              settings.SetBool(c4d.FILENAME_DIRECTORY, True);
              self._filename = self.AddCustomGui(10112, c4d.CUSTOMGUI_FILENAME, "", c4d.BFH_SCALEFIT, 50, 10, settings)
              self.SetString(10112, "C:/temp/")
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 21/02/2016 at 07:06, xxxxxxxx wrote:

        Windows and Macs use different escapes (\\ vs. /) which can easily cause problems.

        Try it like this:

        import c4d  
        def main() :  
            
          path = c4d.storage.LoadDialog(c4d.FILESELECTTYPE_ANYTHING,   
              "Please choose a folder", c4d.FILESELECT_DIRECTORY, "", "c:\\temp")  
          
        if __name__=='__main__':  
          main()
        

        -ScottA

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

          On 21/02/2016 at 11:24, xxxxxxxx wrote:

          Originally posted by xxxxxxxx

          Windows and Macs use different escapes (\\ vs. /) which can easily cause problems.

          Yes, I learned that the hard way.

          Unfortunately that is not the solution.
          The search does with "c:\ emp" or "c:/temp".
          I even tried "c:/temp/"

          Thanks, Pim

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

            On 21/02/2016 at 12:57, xxxxxxxx wrote:

            That's strange.
            The code I posted opens a file browser with the 😄 emp folder selected

            I'm using R13. Maybe something has changed?

            -ScottA

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

              On 22/02/2016 at 00:31, xxxxxxxx wrote:

              Sorry,you are correct, c:\ emp is selected, but not as the top one.
              I see a huge folder tree and then scrolling done I see c:\ emp is indeed selected.
              I would like cinema to scroll down and show the selected folder on top.
              Also the folder is only selected, not opened.

              -Pim

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