Python and linkbox

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

On 23/08/2012 at 06:12, xxxxxxxx wrote:

I'm creating a python plugin.
The GUI is created in the code and not in a res file.

E.g.  self.AddComboBox(MY_COMBOBUTTON, c4d.BFV_MASK)
      self.AddChild(MY_COMBOBUTTON, 0, "Add Selections")     
      self.AddChild(MY_COMBOBUTTON, 1, "Substract Selections" )

How can I add a link box and then drag and drop objects into this linkbox?

_<_img src="http://chicagoc4d.com/c4dpythonsdk/_images/linkbox.png" height="30" width="193" border="0" /_>_

If have seen the documentation in the Cinema 4d Python Help, but I do not quite understand it.
An example would be nice.

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

On 23/08/2012 at 06:33, xxxxxxxx wrote:

To add a linkbox in a dialog you have to use the custom LinkBoxGui. Here's how to create one:

self.linkBox = self.AddCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

You can then call self.linkBox.GetLink()/SetLink() to get/set the linked object.

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

On 23/08/2012 at 07:17, xxxxxxxx wrote:

Thanks very much for the quick and clear reply.
So this is what I have done:

def CreateLayout(self) :
  ... 
  self.linkBox = self.AddCustomGui(MY_LINKBOX, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

and in
def Command(self, id, msg) :
  ...     
  print self.linkBox.GetLink()

What I find very odd, that the getlink does not need an ID. E.g. MY_LINKBOX.
What if I like to use 2 linkboxes?
How to distinguish them?

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

On 23/08/2012 at 07:54, xxxxxxxx wrote:

If you want to use 2 linkboxes I don't see where's the problem:

self.linkBox1 = self.AddCustomGui(MY_LINKBOX1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
self.linkBox2 = self.AddCustomGui(MY_LINKBOX2, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

GetLink() doesn't need a linkbox ID because you call it over an instance of a LinkBoxGui.

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

On 24/08/2012 at 00:38, xxxxxxxx wrote:

Of course, clear. Thanks

On 01/01/2013 at 11:33, xxxxxxxx wrote:

Originally posted by xxxxxxxx

If you want to use 2 linkboxes I don't see where's the problem:

self.linkBox1 = self.AddCustomGui(MY_LINKBOX1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)
self.linkBox2 = self.AddCustomGui(MY_LINKBOX2, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0)

GetLink() doesn't need a linkbox ID because you call it over an instance of a LinkBoxGui.

Hi Yannick Puech, happy new year.

In .res there is a special code to enter?

my file .res:

      LINK CASELLAPERSONALE
      { 
        CENTER_V; ALIGN_LEFT; SIZE 218, 0; 
      }

but not work....

On 01/01/2013 at 12:19, xxxxxxxx wrote:

Hi Caleidos4D,
I got your private message.

I personally always use Add.... for dialogs.
And only use the .res file for things like tags, tools, object's, etc...

GeDialog + .res = Hair Pulling  Tongue

-ScottA

On 01/01/2013 at 13:24, xxxxxxxx wrote:

ah! OK!!! ScottA Thank you  🙂