Unable to get top-level xform without also selecting inside hierarchy

Hi,

I wanted to select and randomly rotate an xform with other xforms within it. I am trying

    item_1= rep.get.prims(
        path_pattern="/Replicator/Ref_Xform/Ref/asset_1/item_1",
        path_pattern_exclusion=[
            "/Replicator/Ref_Xform/Ref/asset_1/item_1/subitem_1",
            "/Replicator/Ref_Xform/Ref/asset_1/item_1/subitem_2",
        ]
    )
    with item_1:
        rep.modify.semantics(semantics=[("class", "item_1")])
        rep.modify.pose(rotation=rep.distribution.uniform((0, 0, 0), (45, 45, 45)))

I am trying to select at item_1 level and rotate randomly all subitems together. Can you please point me in the right direction?

Hello @prpaudyal! I’ve shared your post with the dev team for further assistance.

Hi @prpaudyal , you can use the function rep.get.prim_at_path to select the exact prim.

    item_1= rep.get.prim_at_path(
        path="/Replicator/Ref_Xform/Ref/asset_1/item_1",
    )
    with item_1:
        rep.modify.semantics(semantics=[("class", "item_1")])
        rep.modify.pose(rotation=rep.distribution.uniform((0, 0, 0), (45, 45, 

Thanks. @jiehanw