Load Layout/Menu

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

On 10/09/2011 at 23:56, xxxxxxxx wrote:

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

---------
Hey Guys,

Can anyone told me how to load a layout (*.l4d) or the menubar via C++ like the Chess-PlugIn?

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

On 12/09/2011 at 09:56, xxxxxxxx wrote:

Is it to easy or nobody knows? ;)

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

On 12/09/2011 at 12:50, xxxxxxxx wrote:

I don't do C++ but I imagine you do the same as coffee/python,
just load it as file.

  
// Add a short cut to this to make any sense:) tcastudios.com 2011   
  
var layoutname = "tca"; // <-Your layout name here in quotes and no suffix   
  
var fn = GeGetStartupWritePath();   
    fn->AddLast("library");   
    fn->AddLast("layout");   
    fn->AddLast(layoutname);   
    fn->SetSuffix("l4d");   
  
if(!GeFileExist(fn,FALSE)) // Check if the file excists   
   {   
    println("Ops! No such layout");   
    return;// no such file , bail out   
   }   
  
LoadDocument(fn);   
println(layoutname+" Layout Loaded!");

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

On 12/09/2011 at 21:27, xxxxxxxx wrote:

Here's a very simple C++ example that loads a layout from a button in a dialog type plugin:

Bool myDialog::Command(LONG id,const BaseContainer &msg)    
{  
   
  Filename file = GeGetC4DPath(C4D_PATH_LIBRARY_USER) + "/layout/mylayout.l4d";    //Path to your layout file  
  
  Bool test = GeFExist(file, FALSE);   //Checks to see if the file exists(Second param. searches for the folder if set to TRUE)  
  GePrint(RealToString(test));         //Prints 1 if the file is found..Zero if not found  
  
  
  //To load the layout. I chose to put the code under a button with the ID:"MY_BUTTON"  
  switch (id)   
    {  
    case MY_BUTTON:      
      LoadFile(file);   //Loads the layout file and switches the C4D layout  
      break;  
      
     }  
  
  return TRUE;  
}

-ScottA

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

On 13/09/2011 at 09:09, xxxxxxxx wrote:

Thank you.

I did not know, that I can easly load the file. :)