selecting the active document



  • 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



  • 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



  • 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



  • 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



  • 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:
    http://www.plugincafe.com/forum_browse.asp?action=PREV&messageID=3871



  • 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



  • 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 ;)


Log in to reply