Extrude NegativeExtentDirection stopped working
Hello,
After the last update it seems that specifying NegativeExtentDirection when creating extrude does not work correctly. It goes in the positive direction anyway.
Demo code showing the issue.
Both extrudes are created in the exactly same place, negative one should go in the opposite direction.
#include <Core/CoreAll.h>
#include <Fusion/FusionAll.h>
#include <CAM/CAMAll.h>
using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;
Ptr<Application> app;
Ptr<UserInterface> ui;
extern "C" XI_EXPORT bool run(const char* context)
{
app = Application::get();
ui = app->userInterface();
const auto selections = ui->activeSelections();
if (selections->count() == 0)
return true;
const Ptr<BRepFace> face = selections->item(0)->entity();
if (!face)
return true;
const auto extrudeFeatures = face->body()->parentComponent()->features()->extrudeFeatures();
const auto input = extrudeFeatures->createInput(face, NewBodyFeatureOperation);
const auto distanceExtent = DistanceExtentDefinition::create(ValueInput::createByReal(2));
input->setOneSideExtent(distanceExtent, NegativeExtentDirection);
extrudeFeatures->add(input);
input->setOneSideExtent(distanceExtent, PositiveExtentDirection);
extrudeFeatures->add(input);
return true;
}
extern "C" XI_EXPORT bool stop(const char* context)
{
return true;
}
While specifying negative thickness is a possible workaround, that would require an add-in update.
Link copied