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

    Error when copying...

    SDK Help
    0
    4
    588
    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
      Helper
      last edited by

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

      On 11/03/2003 at 01:42, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   7.3 
      Platform:   Windows  ; Mac  ;  
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,
      When I try to copy an object using GetClone() function, my C4D, gave Illegal Performance and shuts down the application. Where am I doing wrong?

          
          
          
          
          var CurrentDoc = GetActiveDocument();  
          
          
          
          
          
          var objFile = GeGetRootFilename();  
          objFile->RemoveLast();  
          objFile->AddLast("diamond.c4d");
          
          
          
          
          var doc = LoadDocument(objFile);
          
          
          
          
          var DiamondDoc = GetActiveDocument();
          
          
          
          
          var Obj=DiamondDoc->GetFirstObject();
          
          
          
          
          if (Obj)
          
          
          
          
          {  
             var Obj1 = Obj->GetClone(0);  
             CurrentDoc->InsertObject(Obj1,NULL,NULL);
          
          
          
          
             DiamondDoc->Remove();  
             DiamondDoc=NULL;
          
          
          
          
           }  
          
          
          
          
          
          GeEventAdd(DOCUMENT_CHANGED);
          
          
          
      

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

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

        On 11/03/2003 at 11:43, xxxxxxxx wrote:

        I think the problem comes from the line **DiamondDoc- >Remove();
        **The Remove() function works with objects, but it doesn't close a C4D document, it crashs C4D
        I think your goal is to open a C4D file (DiamondDoc), copy the first object in the actual projet (CurrentDoc), then close the last opened document.
        I don't know if there is a way to close a project in COFFEE...

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

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

          On 11/03/2003 at 23:39, xxxxxxxx wrote:

          Even I remove **DiamondDoc- >Remove(); **statement, still I am facing the same pbm.

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

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

            On 18/03/2003 at 10:16, xxxxxxxx wrote:

            H.G. Seib posted some code for merging documents some time ago: <[URL-REMOVED]>. Please give it a try.


            [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