Extrude NegativeExtentDirection stopped working

Extrude NegativeExtentDirection stopped working

rolandas_vegis
Advocate Advocate
878 Views
3 Replies
Message 1 of 4

Extrude NegativeExtentDirection stopped working

rolandas_vegis
Advocate
Advocate

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.

0 Likes
879 Views
3 Replies
Replies (3)
Message 2 of 4

goyals
Autodesk
Autodesk

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. 



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 3 of 4

KrisKaplan
Autodesk
Autodesk

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



Kris Kaplan
0 Likes
Message 4 of 4

Maciej_Rogowski
Enthusiast
Enthusiast

I have the same error. It breaks some of my add-ins.

0 Likes