On 10/12/2014 at 17:44, xxxxxxxx wrote:
The documentation for how to .GetLink () is confusing. It says I need an instance of a LinkboxUI.
I don't know how to retrieve what's contained in the linkbox. Would I need to create the LinkBoxUI instance? If so, how exactly do you do that?
Simple code setup for the UI. Linkbox and a button. Press the button, print what's in the linkbox (well, that's the goal).
import c4d
from c4d import gui
class guiDialog ( gui.GeDialog ) :
lb = 1000
btn = 1001
def CreateLayout ( self ) :
self.AddCustomGui ( self.lb, pluginid = c4d.CUSTOMGUI_LINKBOX, name = "Target Object", flags = c4d.BFH_SCALEFIT, minw = 466, minh = 15 )
self.AddButton ( self.btn, c4d.BFH_SCALEFIT, 120, 15, 'Okay' )
return True
def Command ( self, id, msg ) :
if id == self.btn:
print 'object name'
return True
def main() :
dialog = guiDialog ()
dialog.Open ( dlgtype = c4d.DLG_TYPE_MODAL )
if __name__=='__main__':
main()