View Full Version : [py] qry and edit form layout elements directly.

10 October 2011, 02:54 PM
hi people,

can I qry and edit directly the values inside myVar?
need to get access to several dynamically generated textFieldGrps - python. and I have them all just like this in self.myVar

self.myVar = myUI|formLayout577|sumLayout|textFieldGrp286

thanks for enlightenment.

10 October 2011, 03:24 PM
you can list the children of any layout..? is that what you mean? query the childArray flag


10 October 2011, 03:43 PM
can you elaborate your sentence slightly more..
I am not so familiar with ui stuff :(

well, I only have that ui kind of path as information, but need to know what is written inside the textField, but I don't know how to qry it with giving it the ui path..

10 October 2011, 07:52 PM
well, I assume sumLayout is a layout of some kind, let's pretend it's a columnLayout, you would do:fieldChildren = cmds.columnLayout('sumLayout',q=1,ca=1)If you didn't know or care what type of layout it was you could also do exactly the same thing with the layout command:fieldChildren = cmds.layout('sumLayout',q=1,ca=1)If ALL you have is a string variable containing the full UI path to the textFieldGrp you will have to first extract the path, something like so:layoutPath = self.myVar.rsplit('|',1)[0]but if all you want to do is get the field contents, you would just do something like this, surely:fieldData = cmds.textFieldGrp(self.myVar, q=1, text=1)If none of these help with your issue I have absolutely no idea what you want to do :)

10 October 2011, 07:55 AM
awesome thanks for your detailed information!
I got the values now :)

CGTalk Moderation
10 October 2011, 07:55 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.