<?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: 3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems! in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947811#M22456</link>
    <description>&lt;P&gt;Thanks Brian!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried putting the body and sketch in the root component and I still get the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given the same test .f3d file, here's some code that makes it happen. I'd love to know some work around for this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Corbin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""This file acts as the main module for this script."""

import traceback
import adsk.core
import adsk.fusion
import adsk.cam
from adsk.core import *
from adsk.fusion import *
from adsk.cam import *

def log(message):
	userInterface = adsk.core.Application.get().userInterface
	userInterface.palettes.itemById('TextCommands').writeText(message)


def run(_context: str):
    """This function is called by Fusion when the script is run."""
    app = adsk.core.Application.get()

    try:
        design: Design = app.activeProduct
        

        pocketComponent = design.allComponents.itemByName('Name Pocket')

        inlayComponent = design.allComponents.itemByName('Name Inlay')
        body = inlayComponent.bRepBodies.itemByName('Inlay Body')        
        

        l: list[Base] = []
        inlayOcc = design.rootComponent.occurrencesByComponent(inlayComponent)[0]
        body = body.createForAssemblyContext(inlayOcc)

        body = body.copyToComponent(design.rootComponent)

        l.append(body)
        
        sketch = design.rootComponent.sketches.add(design.rootComponent.xYConstructionPlane)
        sketch.project2(l, True)



    except:  #pylint:disable=bare-except
        # Write the error message to the TEXT COMMANDS window.
        app.log(f'Failed:\n{traceback.format_exc()}')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2025 02:10:53 GMT</pubDate>
    <dc:creator>corbin2</dc:creator>
    <dc:date>2025-12-17T02:10:53Z</dc:date>
    <item>
      <title>3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems!</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947037#M22454</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I've been plagued by this error coming up in my plugin when I'm trying to project a body into a sketch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems!&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;It works when I do it "by hand" outside of code, but doing it in code always fails.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Steps to reproduce the failure:&lt;/DIV&gt;&lt;DIV class=""&gt;1. Open the attached .f3d file&lt;/DIV&gt;&lt;DIV class=""&gt;2. Run the attached script (also inline below for reference).&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Steps to succeed by hand:&lt;/DIV&gt;&lt;DIV class=""&gt;1. Open the attached .f3d file&lt;/DIV&gt;&lt;DIV class=""&gt;2. Edit the Sketch "Machining Boundary" in the component "Name Pocket"&lt;/DIV&gt;&lt;DIV class=""&gt;3. P for Project, select Body, find the Body named "Inlay Body" in the component "Name Inlay".&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;I'm sure there is something wrong with the sketch...I wonder if there is a way I can fix it up to project correctly.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;thanks,&lt;/DIV&gt;&lt;DIV class=""&gt;Corbin&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;"""This file acts as the main module for this script."""

import traceback
import adsk.core
import adsk.fusion
import adsk.cam
from adsk.core import *
from adsk.fusion import *
from adsk.cam import *

def log(message):
	userInterface = adsk.core.Application.get().userInterface
	userInterface.palettes.itemById('TextCommands').writeText(message)



def run(_context: str):
    """This function is called by Fusion when the script is run."""
    app = adsk.core.Application.get()

    try:
        design: Design = app.activeProduct
        

        pocketComponent = design.allComponents.itemByName('Name Pocket')

        inlayComponent = design.allComponents.itemByName('Name Inlay')
        body = inlayComponent.bRepBodies.itemByName('Inlay Body')        
        

        l: list[Base] = []
        inlayOcc = design.rootComponent.occurrencesByComponent(inlayComponent)[0]
        body = body.createForAssemblyContext(inlayOcc)
        l.append(body)
        
        sketch = pocketComponent.sketches.itemByName('Machining Boundary')
        pocketOcc = design.rootComponent.occurrencesByComponent(pocketComponent)[0]
        sketch = sketch.createForAssemblyContext(pocketOcc)
        sketch.project2(l, True)



    except:  #pylint:disable=bare-except
        # Write the error message to the TEXT COMMANDS window.
        app.log(f'Failed:\n{traceback.format_exc()}')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Dec 2025 14:38:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947037#M22454</guid>
      <dc:creator>corbin2</dc:creator>
      <dc:date>2025-12-16T14:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: 3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems!</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947516#M22455</link>
      <description>&lt;P&gt;This looks like a bug to me, where the API isn't correctly handling the projection across components. If you put the body and the sketch in the root component, it works. I think the error message is not correct. I've made sure a bug was logged.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Dec 2025 20:22:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947516#M22455</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-12-16T20:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems!</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947811#M22456</link>
      <description>&lt;P&gt;Thanks Brian!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried putting the body and sketch in the root component and I still get the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given the same test .f3d file, here's some code that makes it happen. I'd love to know some work around for this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Corbin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""This file acts as the main module for this script."""

import traceback
import adsk.core
import adsk.fusion
import adsk.cam
from adsk.core import *
from adsk.fusion import *
from adsk.cam import *

def log(message):
	userInterface = adsk.core.Application.get().userInterface
	userInterface.palettes.itemById('TextCommands').writeText(message)


def run(_context: str):
    """This function is called by Fusion when the script is run."""
    app = adsk.core.Application.get()

    try:
        design: Design = app.activeProduct
        

        pocketComponent = design.allComponents.itemByName('Name Pocket')

        inlayComponent = design.allComponents.itemByName('Name Inlay')
        body = inlayComponent.bRepBodies.itemByName('Inlay Body')        
        

        l: list[Base] = []
        inlayOcc = design.rootComponent.occurrencesByComponent(inlayComponent)[0]
        body = body.createForAssemblyContext(inlayOcc)

        body = body.copyToComponent(design.rootComponent)

        l.append(body)
        
        sketch = design.rootComponent.sketches.add(design.rootComponent.xYConstructionPlane)
        sketch.project2(l, True)



    except:  #pylint:disable=bare-except
        # Write the error message to the TEXT COMMANDS window.
        app.log(f'Failed:\n{traceback.format_exc()}')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 02:10:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13947811#M22456</guid>
      <dc:creator>corbin2</dc:creator>
      <dc:date>2025-12-17T02:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: 3 : Projection of the selected spline/curve would result in a degenerate segment and cause future modeling problems!</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13952040#M22463</link>
      <description>&lt;P&gt;I figured out a semi-workaround by extruding another set of the profiles I want in the same component; that seems to work, as long as the extrusion isn't combined with any other part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still can get the degenerate error to happen in other cases...but it might actually be related to bad sketches. I need to investigate and isolate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Corbin&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 21:31:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/3-projection-of-the-selected-spline-curve-would-result-in-a/m-p/13952040#M22463</guid>
      <dc:creator>corbin2</dc:creator>
      <dc:date>2025-12-19T21:31:22Z</dc:date>
    </item>
  </channel>
</rss>

