<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extrude NegativeExtentDirection stopped working in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10027904#M9608</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the last update it seems that specifying NegativeExtentDirection when creating extrude does not work correctly. It goes in the positive direction anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Demo code showing the issue.&lt;/P&gt;&lt;P&gt;Both extrudes are created in the exactly same place, negative one should go in the opposite direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;Core/CoreAll.h&amp;gt;
#include &amp;lt;Fusion/FusionAll.h&amp;gt;
#include &amp;lt;CAM/CAMAll.h&amp;gt;

using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;

Ptr&amp;lt;Application&amp;gt; app;
Ptr&amp;lt;UserInterface&amp;gt; ui;

extern "C" XI_EXPORT bool run(const char* context)
{
	app = Application::get();
	ui = app-&amp;gt;userInterface();

	const auto selections = ui-&amp;gt;activeSelections();
	if (selections-&amp;gt;count() == 0)
		return true;

	const Ptr&amp;lt;BRepFace&amp;gt; face = selections-&amp;gt;item(0)-&amp;gt;entity();
	if (!face)
		return true;

	const auto extrudeFeatures = face-&amp;gt;body()-&amp;gt;parentComponent()-&amp;gt;features()-&amp;gt;extrudeFeatures();
	
	const auto input = extrudeFeatures-&amp;gt;createInput(face, NewBodyFeatureOperation);
	const auto distanceExtent = DistanceExtentDefinition::create(ValueInput::createByReal(2));
	input-&amp;gt;setOneSideExtent(distanceExtent, NegativeExtentDirection);
	extrudeFeatures-&amp;gt;add(input);

	input-&amp;gt;setOneSideExtent(distanceExtent, PositiveExtentDirection);
	extrudeFeatures-&amp;gt;add(input);

	return true;
}

extern "C" XI_EXPORT bool stop(const char* context)
{
	return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;While specifying negative thickness is a possible workaround, that would require an add-in update.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 08:03:24 GMT</pubDate>
    <dc:creator>rolandas_vegis</dc:creator>
    <dc:date>2021-01-25T08:03:24Z</dc:date>
    <item>
      <title>Extrude NegativeExtentDirection stopped working</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10027904#M9608</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the last update it seems that specifying NegativeExtentDirection when creating extrude does not work correctly. It goes in the positive direction anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Demo code showing the issue.&lt;/P&gt;&lt;P&gt;Both extrudes are created in the exactly same place, negative one should go in the opposite direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;Core/CoreAll.h&amp;gt;
#include &amp;lt;Fusion/FusionAll.h&amp;gt;
#include &amp;lt;CAM/CAMAll.h&amp;gt;

using namespace adsk::core;
using namespace adsk::fusion;
using namespace adsk::cam;

Ptr&amp;lt;Application&amp;gt; app;
Ptr&amp;lt;UserInterface&amp;gt; ui;

extern "C" XI_EXPORT bool run(const char* context)
{
	app = Application::get();
	ui = app-&amp;gt;userInterface();

	const auto selections = ui-&amp;gt;activeSelections();
	if (selections-&amp;gt;count() == 0)
		return true;

	const Ptr&amp;lt;BRepFace&amp;gt; face = selections-&amp;gt;item(0)-&amp;gt;entity();
	if (!face)
		return true;

	const auto extrudeFeatures = face-&amp;gt;body()-&amp;gt;parentComponent()-&amp;gt;features()-&amp;gt;extrudeFeatures();
	
	const auto input = extrudeFeatures-&amp;gt;createInput(face, NewBodyFeatureOperation);
	const auto distanceExtent = DistanceExtentDefinition::create(ValueInput::createByReal(2));
	input-&amp;gt;setOneSideExtent(distanceExtent, NegativeExtentDirection);
	extrudeFeatures-&amp;gt;add(input);

	input-&amp;gt;setOneSideExtent(distanceExtent, PositiveExtentDirection);
	extrudeFeatures-&amp;gt;add(input);

	return true;
}

extern "C" XI_EXPORT bool stop(const char* context)
{
	return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;While specifying negative thickness is a possible workaround, that would require an add-in update.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 08:03:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10027904#M9608</guid>
      <dc:creator>rolandas_vegis</dc:creator>
      <dc:date>2021-01-25T08:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude NegativeExtentDirection stopped working</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10030760#M9609</link>
      <description>&lt;P&gt;I am able to see the problem and will do more investiggation on our side. Created&amp;nbsp;FUS-77544 ticket to track it. Thanks for reporting this issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 03:42:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10030760#M9609</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2021-01-26T03:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude NegativeExtentDirection stopped working</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10032399#M9610</link>
      <description>&lt;P&gt;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).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 15:49:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10032399#M9610</guid>
      <dc:creator>KrisKaplan</dc:creator>
      <dc:date>2021-01-26T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude NegativeExtentDirection stopped working</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10038846#M9611</link>
      <description>&lt;P&gt;I have the same error. It breaks some of my add-ins.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 14:51:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-negativeextentdirection-stopped-working/m-p/10038846#M9611</guid>
      <dc:creator>Maciej_Rogowski</dc:creator>
      <dc:date>2021-01-28T14:51:49Z</dc:date>
    </item>
  </channel>
</rss>

