modify the transform of sub assembly to its parent level

problem

I'm trying to modify the transform of sub assembly to its parent level using XCAFDoc_Location::Set() method. The problem is when I export the model to step and read it again, I find the location doesn't change. I have tried to solve is, using shape_tool->UpdateAssemblies() or doc->Recompute().

gp_Trsf newTransform;
newTransform.SetTranslation(gp_Vec(100.0, 0.0, 0.0));
TopLoc_Location newLoc = currentLoc * TopLoc_Location(newTransform);

TDF_Label newlabel;
XCAFDoc_Location::Set(foundLabel, newLoc);
shapeTool->UpdateAssemblies();
Attachments: 
Dmitrii Pasukhin's picture

Hello. Can you share on which level of assembly tree you put that attribute? (root, part, instance, sub shape)

XCAFDoc_Location is not handle on level of subshapes. And it is not stable on level of parts. The best thing is work with instance's location of the part.

Best regards, Dmitrii.