Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can i modify or replace a shape for an assembly ? (Adding new shape replacing the old opencascade shape) #261

Open
RajanHexa opened this issue Oct 2, 2023 · 0 comments

Comments

@RajanHexa
Copy link

RajanHexa commented Oct 2, 2023

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)
    }
}
@RajanHexa RajanHexa changed the title can i modify or replace a shape for an assembly ? (Adding new shape replacing the old opencascade shape). 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 can i modify or replace a shape for an assembly ? (Adding new shape replacing the old opencascade shape) Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant