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
    • Recent
    • Tags
    • Users
    • Login

    Save active doc and reopen it

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 241 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 26/06/2014 at 07:40, xxxxxxxx wrote:

      Hello,

      I want to duplicate the active document to a fixed location and still have the original document open (or reopend).

      How can this be done?

      I got stuck right in the beginning, as I want a InputDialog to rename the duplicate and "documents.GetActiveDocument()" only gives me an ID and my "GetData(c4d.DOCUMENT_NAME)" isn't working.

      After that I can't work out how do save it as a copy or reopen it from the old position.

      Can someone please help me with this?
      TF

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

        On 27/06/2014 at 04:03, xxxxxxxx wrote:

        You should be able to get the path with a combination of:

          
        myDoc = GetActiveDocument()
        originalDocPath = myDoc.GetDocumentPath() + "/" + myDoc.GetDocumentName()
        # ^ Might have to append the doc name to it not sure
        

        And then just do a save document then a load document, something like..

        SaveDocument(myDoc, SAVEDOCUMENTFLAGS_DIALOGSALLOWED, FORMAT_C4DEXPORT)
        #LoadDocument() or LoadFile()
        

        Roughly like that i think..

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

          On 07/07/2014 at 01:40, xxxxxxxx wrote:

          Thanks a bunch! Learning Python better day by day...

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