Similarly to the cmds.polySphere() command, the return value is a list, containing both the transform and the shape that was created.
# Result: [nt.Transform(u'pSphere1'), nt.PolySphere(u'polySphere1')] # The error you are receiving is telling you that a list indeed has no attribute called 'translateX'. What you would need to do is reference the item you want by list index. If you are trying to call translateX on the transform object, then you might want this: test[0].translateX.get() Or to be more verbose: trans = test[0] test.translateX.get() Sequence objects (list, tuple, string, ...) allow access to their elements by indexing, which starts at 0 in python. If you wanted to shape node from this list, you would do: shape = test[1] On Aug 19, 2012, at 6:25 AM, Christian Bohm wrote: > Hi everyone, > > I am trying to learn pymel and am working with the manual right now. > There was one easy example in the "getting started"-section, which should > give me tx of a object: > > from pymel.core import * > test=polySphere() > test.translateX.get() > > Unfortunately it gives out an error: > [...] file <maya console> line 3: 'list' object has no attribute 'translateX' > # > > I know its a freakin simple problem, but I try to get around that for one > hour now > and need some help, please. > > BTW: Is there a news group for beginners like me, so I dont have to bother > you in the future? > > Thanks in advance! > Chris > > > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
