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.
I am able to see the problem and will do more investiggation on our side. Created FUS-77544 ticket to track it. Thanks for reporting this issue.
FWIW: Until this is fixed, there is a fairly simple workaround. Just as in the interactive Extrude command, there isn't really a 'positive/negative' flip direction state. To extrude in the negative distance, it really just uses a negative direction. So you can create a negative extent extrude by just using PositiveExtentDirection and a negative value, e.g. ValueInput.createByReal(-2).
Kris