pymel functions are equivalent to maya.cmds functions, so it would be
exactly the same:

import pymel as pm
button = pm.button('myButton', l='Sone Damn Button')     # returns a pymel
Button object, instead of a string

This is only useful of you're trying to keep track of gui elements globally
in the maya session, such as to make sure there's only one instance of your
window:


if pm.window("MyWindow", q=True, ex=True):
    pm.deleteUI("MyWindow")

win = pymel.window("MyWindow")
win.show()


- Ofer
www.mrbroken.com


On Tue, Apr 6, 2010 at 4:24 PM, shawnpatapoff <[email protected]>wrote:

> I've been reading the pymel docs and have some basic questions about
> UI creation. How do you go about testing if a window is all ready
> created then delete it? Traditionally I'm using
>
> if cmds.window('myWin'm ex=True):
>   cmds.deleteUI('myWin')
>
> Reading the tutorial information and don't know how to specify a
> control name:
> button = cmds.button('myButton', l='Sone Damn Button')
>
> what would be the equivalent in pyMel?
>
> I'm basically going to transition all our new tools into pyMel. Three
> cheers for learning curves!
>
> Cheers,
> Shawn
>
> --
> http://groups.google.com/group/python_inside_maya
>
> To unsubscribe, reply using "remove me" as the subject.
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to