@m_magalhaes @zipit
I have created code that demonstrates both issues: not receiving the Message and not working without print. Please give it a try; dock both Plugin 1 & 2 in the UI, launch Plugin 1, and click the 'Toggle Plugin 2 Enable' button.
import c4d
PLUGIN1_ID = 1234567
PLUGIN2_ID = 2345678
ACTIVATE_ID = 9999999
BUTTON_ID = 1000
class Plugin1_UI(c4d.gui.GeDialog):
active = False
def CreateLayout(self):
self.SetTitle("Plugin 1")
self.GroupBorderSpace(10,10,10,10)
self.AddButton(BUTTON_ID, c4d.BFH_CENTER | c4d.BFH_SCALE | c4d.BFV_CENTER | c4d.BFV_SCALE, initw=0, inith=0, name="Toggle Plugin 2 Enable")
return True
def Command(self, id, msg):
if id==BUTTON_ID:
"""
Editing document's BaseContainer
"""
doc = c4d.documents.GetActiveDocument()
docBC = doc.GetDataInstance()
subBc = c4d.BaseContainer()
self.active = not self.active
subBc[PLUGIN2_ID] = self.active
docBC.SetContainer(PLUGIN1_ID, subBc)
doc.SetData(docBC)
print doc[PLUGIN1_ID][PLUGIN2_ID] #<--will not update without this
"""
Sending a Message
"""
node = c4d.plugins.FindPlugin(PLUGIN2_ID)
node.Message(ACTIVATE_ID)
return True
class Plugin1_CommandData(c4d.plugins.CommandData):
def Execute(self,doc):
global dlg
dlg = Plugin1_UI()
return dlg.Open(dlgtype=c4d.DLG_TYPE_ASYNC, xpos=-2, ypos=-2, \
pluginid=PLUGIN1_ID, defaultw=100, defaulth=100)
class Plugin2_CommandData(c4d.plugins.CommandData):
def Message(self, type, data):
if type == ACTIVATE_ID:
print "Message: %s"%type
#print type, data
return True
def GetState(self, doc):
if not doc[PLUGIN1_ID] or not doc[PLUGIN1_ID][PLUGIN2_ID]:
return False
return c4d.CMD_ENABLED
def Execute(self,doc):
return True
c4d.plugins.RegisterCommandPlugin(id=PLUGIN1_ID,
str="Plugin 1",
info=0,
help="Plugin 1 help text",
dat=Plugin1_CommandData(),
icon=None)
c4d.plugins.RegisterCommandPlugin(id=PLUGIN2_ID,
str="Plugin 2",
info=0,
help="Plugin 2 help text",
dat=Plugin2_CommandData(),
icon=None)

I'm interested in whichever way I can get to work properly: messaging the plugin or storing the state in the document's BaseContainer. Neither is working for me right now. Thank you both.