You can delete this topic, if you want, because I already solved the problem =)
The working part (Assembly) contains components that are not subassemblies. Components contains the features build tree, including datums, axes, sketches, extrudes. Need to move components with specific attributes and their objects (datums, axes, sketches, extrudes)on layer 10 of the assembly.
I used this code http://www.nxjournaling.com/content/creating-subroutine-process-all-comp... and was able to sort the components I need and move them on a assembly layer, but don't know how to move the contents of the components.
if child.GetStringAttribute("DB_PART_TYPE")="type1" Then
ufs.obj.SetLayer(child.tag, 10)
end if
Code transfers the contents of the component if they belong to the same layer with the component. But if I manually transfer the contents(datums, axes, sketches, extrudes) (by using the selection filter) to another layer of the assembly, the code move only component but not of its contents.
Done!
Now I have modified the code using SetLayerOption Method:
if child.GetStringAttribute("DB_PART_TYPE")="sdb_Fast" Then
child.SetLayerOption(-1)
ufs.obj.SetLayer(child.tag, 10)
end if