<?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 Re: Extrude using API fails on some faces in this model in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12959261#M974</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to reproduce the same error with a Python script.&amp;nbsp; Very extrange this error, since the extrude path is calculated internally which is perpendicular to the face selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a workaround you can create a sketch on that face, project the face into the sketch which creates a profile sketch, and then use that profile to make the extrude.&amp;nbsp; It worked for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jorge Jaramillo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2024 20:05:06 GMT</pubDate>
    <dc:creator>Jorge_Jaramillo</dc:creator>
    <dc:date>2024-08-14T20:05:06Z</dc:date>
    <item>
      <title>Extrude using API fails on some faces in this model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12957672#M973</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got a model where extrude is failing on some faces.&lt;/P&gt;&lt;P&gt;The face being extruded is flat, plane face, yet the error message says: &lt;EM&gt;EXTRUDE_CREATION_FAIL_ERROR - Cannot complete extrusion. / ASM_PATH_TANGENT - The path is tangent to the profile. Try adjusting the path or rotating the profile.&amp;nbsp;&lt;/EM&gt;Which does not make much sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Demo code which reproduces the issue:&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;

extern "C" XI_EXPORT bool run(const char* context)
{
	app = Application::get();
	Ptr&amp;lt;Component&amp;gt; root = app-&amp;gt;activeEditObject();
	auto occurrences = root-&amp;gt;allOccurrences();
	auto occ = occurrences-&amp;gt;itemByName("Cappello_del_corpo_mobile[Q02C-005M]:1");
	auto faces = occ-&amp;gt;bRepBodies()-&amp;gt;item(0)-&amp;gt;faces();
	Ptr&amp;lt;BRepFace&amp;gt; targetFace;
	auto targetFaceArea = 113.759999999;
	for (auto i = 0; i &amp;lt; faces-&amp;gt;count(); i++)
	{
		auto face = faces-&amp;gt;item(i);
		auto area = face-&amp;gt;area();
		if (fabs(area - targetFaceArea) &amp;lt; 0.0000001)
		{
			targetFace = face;
			break;
		}
	}

	//Extrude
	const auto component = occ-&amp;gt;component();
	const auto features = component-&amp;gt;features();
	const auto extrudeFeatures = features-&amp;gt;extrudeFeatures();
	const auto extrudeInput = extrudeFeatures-&amp;gt;createInput(targetFace, NewComponentFeatureOperation);
	const auto valueInput = ValueInput::createByReal(1);
	const auto distanceExtent = DistanceExtentDefinition::create(valueInput);
	extrudeInput-&amp;gt;setOneSideExtent(distanceExtent, PositiveExtentDirection);
	const auto extrudeFeature = extrudeFeatures-&amp;gt;add(extrudeInput);

	std::string lastError;
	app-&amp;gt;getLastError(&amp;amp;lastError);
	app-&amp;gt;userInterface()-&amp;gt;messageBox(lastError);
	return true;
}

extern "C" XI_EXPORT bool stop(const char* context)
{
	return true;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to the model: &lt;A href="https://a360.co/4dysf22" target="_blank"&gt;https://a360.co/4dysf22&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 08:19:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12957672#M973</guid>
      <dc:creator>rolandas_vegis</dc:creator>
      <dc:date>2024-08-14T08:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude using API fails on some faces in this model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12959261#M974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to reproduce the same error with a Python script.&amp;nbsp; Very extrange this error, since the extrude path is calculated internally which is perpendicular to the face selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a workaround you can create a sketch on that face, project the face into the sketch which creates a profile sketch, and then use that profile to make the extrude.&amp;nbsp; It worked for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jorge Jaramillo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 20:05:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12959261#M974</guid>
      <dc:creator>Jorge_Jaramillo</dc:creator>
      <dc:date>2024-08-14T20:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude using API fails on some faces in this model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12966577#M975</link>
      <description>Thanks, your workaround does indeed work, but a bug fix for this would be even better.</description>
      <pubDate>Mon, 19 Aug 2024 05:43:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12966577#M975</guid>
      <dc:creator>rolandas_vegis</dc:creator>
      <dc:date>2024-08-19T05:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extrude using API fails on some faces in this model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12967206#M976</link>
      <description>&lt;P&gt;Also it looks like the directions returned by orientedMinimumBoundingBox are wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rolandas_vegis_0-1724066103077.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1399357i817D8F117DC16C6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rolandas_vegis_0-1724066103077.png" alt="rolandas_vegis_0-1724066103077.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rolandas_vegis_1-1724066199415.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1399359iB58CA0FE3EB99E89/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rolandas_vegis_1-1724066199415.png" alt="rolandas_vegis_1-1724066199415.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Created 2 same bodies in different models and drew the Axes I get from OrientedBoundingBox3D.&amp;nbsp; The first screenshot is from the model I provided in this post and is wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This body has a thickness of 0.001, which is returned as length in the oriented box. So oriented box length should be the red arrow looking directly at the screen, yet it is pointing up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It could be that something in this model is impacting both the extrude and the orientedMinimumBoundingBox.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 11:20:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/extrude-using-api-fails-on-some-faces-in-this-model/m-p/12967206#M976</guid>
      <dc:creator>rolandas_vegis</dc:creator>
      <dc:date>2024-08-19T11:20:32Z</dc:date>
    </item>
  </channel>
</rss>

