Message 1 of 4
Inconsistent behaviour when trimming a sketch circle and history capture is enabled. Bug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a bit of code that uses a two large circles and a couple of straight lines to produce a box with curved edges.
When design history is on the trim deletes the circles profile. When design history is off the trim does not delete the circles profile. Both delete the curve circle but one leaves the profile behind. Is this expected behaviour?
With History Enabled
Without History
The following is code to reproduce the issue:
Ptr<Application> ptrApplication = Application::get();
Ptr<Design> ptrDesign = ptrApplication->activeProduct();
// NOTE: If running with no design history the second split call seems to fail
// ptrDesign->designType(DesignTypes::DirectDesignType);
Ptr<Component> ptrRoot = ptrDesign->rootComponent();
Ptr<Sketch> sketchTop = ptrRoot->sketches()->add(ptrRoot->xZConstructionPlane());
sketchTop->isVisible(true);
sketchTop->sketchCurves()->sketchLines()->addByTwoPoints(Point3D::create(-17.250000, 1.703300, 32.500000), Point3D::create(17.250000, 1.703300, 32.500000));
sketchTop->sketchCurves()->sketchLines()->addByTwoPoints(Point3D::create(-15.745000, 18.930000, 32.500000), Point3D::create(15.745000, 18.930000, 32.500000));
Ptr<SketchCircle> oCircleProfile = sketchTop->sketchCurves()->sketchCircles()->addByCenterRadius( Point3D::create(-112.750000, 1.703300, 32.500000), 120.000000);
oCircleProfile->split(Point3D::create(5.745000, 18.930000, 32.500000), false);
oCircleProfile->trim( Point3D::create(5.745000, 18.930000, 32.500000), false);
Ptr<SketchCircle> oCircleProfile2 = sketchTop->sketchCurves()->sketchCircles()->addByCenterRadius( Point3D::create(112.750000, 1.703300, 32.500000), 120.000000);
oCircleProfile2->split(Point3D::create(-5.745000, 18.930000, 32.500000), false);
oCircleProfile2->trim( Point3D::create(-5.745000, 18.930000, 32.500000), false);
Application::get()->activeViewport()->fit();