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

    selecting the active document

    SDK Help
    0
    7
    718
    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 23/03/2004 at 01:50, xxxxxxxx wrote:

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

      ---------
      Hi,

      is there a way to make a loaded document active (and the one actually diaplayed in the editor)?

      I want to load an object from a file to the active scene. Here's what I do:

        
      ...  
      var doc = GetActiveDocument();  
      LoadDocument(my_doc);  
      var temp_doc = GetActiveDocument();  
      var temp_op=temp_doc->GetFirstObject()->GetClone(CL_NO_BITS);  
      KillDocument(temp_doc);  
      doc->InsertObject(temp_op,NULL,NULL);  
      

      now my object is in my scene. The temp document where it came from is closed again. If there is only my scene open, everything is fine, but if there are other scenes open as well, the last one opened becomes the active one in the editor with my scene and the newly inserted object hidden. Now I want to make my scene active again. Here's what I tried:

        
      var active_doc = GetActiveDocument();  
      while(active_doc)  
      {  
         if(active_doc != doc) active_doc->DelBit(BIT_ADOC);  
         else   
         {  
            active_doc->SetBit(BIT_ADOC);  
            break;  
         }  
         active_doc = active_doc->GetNext();  
      }  
      GeEventAdd(MSG_UPDATE);  
      println(GetActiveDocument()->GetFirstObject()->GetName();  
      

      Now the name of the first object of my scene (the one I've just inserted) gets printed in the console, indicating that my scene is in fact the 'active document'. Unfortunatly it's still not the one displayed in the editor!

      What am I doing wrong? Is there a way of changing the active document?

      Many thanks in advance

      Fabian

      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 23/03/2004 at 01:58, xxxxxxxx wrote:

        Sorry, the version I'm testing this with is actually 8.5.

        Fabian

        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 23/03/2004 at 14:21, xxxxxxxx wrote:

          Hi fabian,
          afaik this is broken! I also needed this some time ago when I coded in coffee.
          Samir

          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 23/03/2004 at 22:52, xxxxxxxx wrote:

            Well, if there's no way to do it, I can live with that. 😞 Needs a limitation note in the documentation. But maybe there is a way and I'm missing something. Mikael?

            Thanks, Samir!

            Fabian

            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 24/03/2004 at 01:50, xxxxxxxx wrote:

              No, there is no other way. Mikael, didn´t answer back then and I doubt he can change COFFEE himself 😉
              also see my inquiry sooooome time ago:
              [URL-REMOVED][URL-REMOVED]


              [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

              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 24/03/2004 at 02:00, xxxxxxxx wrote:

                Ok, thank you again Samir!

                This is getting a little unpleasant, I think I should really start learning C++.

                Best regards

                Fabian

                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 24/03/2004 at 03:16, xxxxxxxx wrote:

                  yeah, and I think COFFEE should finally be updated 😉

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