i have the following code for replacing the shape for non assembly model but it doesn't work on an assembly. so is there any different approach for it
function replaceOpenCascadeShape(inShapeTool, oldOpenCascadeShape, newOpenCascadeShape, openCascade) {
let reShapeTool = new openCascade.BRepTools_ReShape()
reShapeTool.Replace(oldOpenCascadeShape, newOpenCascadeShape)
let label = inShapeTool.FindShape_2(oldOpenCascadeShape, true);
let newShape = reShapeTool.Apply(newOpenCascadeShape, openCascade.TopAbs_ShapeEnum.TopAbs_SHAPE)
let assembly = getAssembly(inShapeTool, openCascade)
if (!openCascade.XCAFDoc_ShapeTool.IsAssembly(assembly)) {
inShapeTool.SetShape(label, newShape)
}
}
i have the following code for replacing the shape for non assembly model but it doesn't work on an assembly. so is there any different approach for it