Wow! Thank you soooooooooooo much!
Those parts were missing. Works like a charm now!
can't thank you enough!
We can close now this topic
It is not working, and script isn't executable as I said in previously message,
thank you for your reply,
from c4d import gui
#Welcome to the world of Python
self.AddComboBox(5000, c4d.BFH_LEFT, 100, 10, False)
self.AddChild(5000, 0, "Child 0")
self.AddChild(5000, 1, "Child 1")
self.AddChild(5000, 2, "Child 2")
def Command(self, id, msg):
# print currently selected "child""
if id == 5000:
value = self.GetInt32(5000)
print("got value: " + str(value))
return c4d.gui.GeDialog.Command(self, id, msg)
# custom function
dialog = TestDialog()
dialog.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, 132456, -1 ,-1 ,400 ,400)
value = dialog.GetSelectedChild()
@s_bach Hello Sebastian!
The main issue is when I implement command and custom member function into the whole script how you suggest in to previously reply, nothing happening and the script wouldn't work.Or when I just copy your code example in to script manager nothing happening,I am using R17 if that can maybe be one of the reasons why script not work?
Thank you for reply!
Hi Sebastian! Thanks a lot for your reply!!!
and for clarifying me about posting and categories
I couldn't figure out at the end to add command and that all complete script works by example that you send me here.
Maybe I wasn't clear enough of what I trying to do and to get as the final result.
My goal is that I make preset with names e.g child 0-or final name "Bath" and when I run script and chose from dropping menu of combo box e.g name "Bath" or some other next selection child 2 or final name "Patio" by selection from item with ready name "Patio" script and code automatically rename new spline based on selection from combobox eg I draw new Spline> and when I select from combo box child's selection Patio command will automatically rename spline to Patio,if is that possible? Plugin cafe is simply awesome,and I am happy so happy to discover it.
Thanks a lot for your reply!
I am new with python scripting so I stuck with this and sorry for my question
I trying to make a script -later plugin also that will rename automatically e.g.spline by selection from combo box menu with new selected name
is there a way to add children -6+ options to combo box and send rename command based on a selection from combo box? Here is what I mean and a sample .I find 2 ways for this but I would like to have combobox selection and dropping menu
Here are 2 examples that I make:
from c4d import gui
# Dialog layout settings
self.SetTitle('Spline Renamer 1.1')
#Setting widget etc.
self.GroupBegin(10000, c4d.BFH_SCALEFIT, 1, title = 'Select New Spline Name')
self.GroupBorderSpace(20, 5, 20, 5)
self.AddComboBox(1000, c4d.BFH_SCALEFIT, 80, 0, False)
self.AddChild(1000, 0, 'B1')
self.AddChild(1000, 1, 'B2')
self.AddChild(1000, 2, 'B3')
self.AddChild(1000, 3, 'B4')
self.AddChild(1000, 4, 'Main')
self.AddChild(1000, 5, 'Outer')
self.AddChild(1000, 6, 'Patio')
self.AddChild(1000, 7, 'Bath 1')
self.AddChild(1000, 8, 'Bath 2')
self.AddChild(1000, 9, 'Bath 3')
self.AddChild(1000, 10, 'WIC')
dlg = MyDialogs()
This Example 2 works but I dont have combobox or droping menu:
objs = doc.GetActiveObjects(1)
if len(objs) == 0:return
newName = gui.InputDialog("New Name","B1")
if newName == "":return
num = gui.InputDialog("Are you sure?","B1")
if num == "":return
for obj in objs:
obj.SetName(newName +" ")
GeDialog.SetPopup("B 12 ", " B 22")
Thanks you so much for any of your help and for your time,
have a great day!