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

    Read files and run

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 309 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 19/09/2008 at 10:35, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.5 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi ..

      is there any way to open files like *.txt ??

      and when they opened is possible to run the code inside them ??

      example :

      i put code to create a cube in txt file ...

      can i open the txt file and run it ... to create the cube ???

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 19/09/2008 at 11:56, xxxxxxxx wrote:

        hi!

        Its possible, check the class BaseFile.

        You want to run code? Which code? You have to write your own parser or you take the hook for coffee to allow custom code in your plugin. See "c4d_coffee"

        Bye.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 19/09/2008 at 18:40, xxxxxxxx wrote:

          lets say that i have this code :

          BaseObject *cube = BaseObject::Alloc(Ocube);
          cube->SetName("cube");
          doc->InsertObject(cube, NULL, NULL);

          and save it in c:\file.txt

          how i open the file.txt and run the code to create the cube ???

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 19/09/2008 at 21:29, xxxxxxxx wrote:

            Won't work. The cube is a parametric Cinema 4D object. All of the 'code' exists in Cinema 4D and the only data saved to disk that recreates it is in the c4d file.

            In order to save the cube as a text file it would be to save the parameters in some textual format and recreate the parametric object from these when read back in. So, you would need to set up a file format something like this maybe:

            OBJECT cube
            size: 100, 100, 100
            divs: 16, 16, 16
            rotation: 0, 0, 0
            translation: 0, 1, 0
            scale: 1, 1, 1
            ...

            You get the point. You'll need to have code to write a file with this information and to read the file with this information and the code to understand these keywords and formatting to recreate the object in question in Cinema 4D.

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