<?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: Is Point Along Path not available from the API? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9657483#M11150</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239"&gt;@MichaelT_123&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I found the ConstructionPlaneInput.setByDistanceOnPath Method. I'm going to create a point of intersection between this plane and the path&lt;BR /&gt;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-46dd5f0a-e384-4707-b431-37c0e596f328" target="_blank" rel="noopener"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-46dd5f0a-e384-4707-b431-37c0e596f328&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 14:10:02 GMT</pubDate>
    <dc:creator>reisyu</dc:creator>
    <dc:date>2020-07-27T14:10:02Z</dc:date>
    <item>
      <title>Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9655613#M11145</link>
      <description>&lt;P&gt;I want to use Point Along Path with the Fusion360 API.&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="reisyu_0-1595749916671.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/799576iAE8E91D1D6EB809D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="reisyu_0-1595749916671.png" alt="reisyu_0-1595749916671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I looked at the ConstructionPointInput Object page.&lt;/P&gt;&lt;P&gt;But I didn't see Point Along Path in the reference manual.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-b3ffae9a-d7d7-48ee-bd66-b1138536767f" target="_blank"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-b3ffae9a-d7d7-48ee-bd66-b1138536767f&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is Point Along Path not available from the API?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2020 08:00:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9655613#M11145</guid>
      <dc:creator>reisyu</dc:creator>
      <dc:date>2020-07-26T08:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656362#M11146</link>
      <description>&lt;P&gt;Yes, it is, &lt;EM&gt;&lt;STRONG&gt;Mr Reisyu.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 00:56:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656362#M11146</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2020-07-27T00:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656444#M11147</link>
      <description>&lt;P&gt;"Application.executeTextCommand" can be used to create it to some extent.　I've created a sample.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;#Fusion360API python script
#Description-create PointAlongPath sample

import adsk.core, adsk.fusion, traceback

_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)

def run(context):
    try:
        global _app, _ui
        _app = adsk.core.Application.get()
        _ui = _app.userInterface

        # new doc
        _app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        des  :adsk.fusion.Design = _app.activeProduct
        des.designType = adsk.fusion.DesignTypes.ParametricDesignType
        root :adsk.fusion.Component = des.rootComponent

        # create sketch
        crv = initSktCircle(root)

        # create pipe
        initPointAlongPath(crv, 0.5)

        # create sketch
        crv = initSktSpline(root)

        # create pipe
        initPointAlongPath(crv, 0.3)

    except:
        if _ui:
            _ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def initSktSpline(comp :adsk.fusion.Component):
    skt :adsk.fusion.Sketch = comp.sketches.add(comp.xYConstructionPlane)

    poss = [[-1,2,5], [2,1,0], [0,-4,2], [-2,5,-2]]

    pnt3D = adsk.core.Point3D
    objs = adsk.core.ObjectCollection.create()
    [objs.add(pnt3D.create(x,y,z)) for (x,y,z) in poss]
        
    crvs :adsk.fusion.SketchCurves = skt.sketchCurves
    crv = crvs.sketchFittedSplines.add(objs)

    return crv

def initSktCircle(comp :adsk.fusion.Component):
    skt :adsk.fusion.Sketch = comp.sketches.add(comp.xYConstructionPlane)

    pnt3D = adsk.core.Point3D
    crvs :adsk.fusion.SketchCurves = skt.sketchCurves
    crv = crvs.sketchCircles.addByCenterRadius(pnt3D.create(-5.0,-5,0), 4.0)

    return crv

def initPointAlongPath(path, ratio):

    txtCmds = [
        u'Commands.Start WorkPointAlongPathCommand', # show dialog
        u'Commands.SetDouble WORKGEOM_POP_ALONG {}'.format(ratio), # input distance
        u'NuCommands.CommitCmd' # execute command
    ]
    
    sels = _ui.activeSelections
    sels.clear()
    sels.add(path)

    for cmd in txtCmds:
        _app.executeTextCommand(cmd)

    sels.clear()&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Here's how to use TextCommands and how to find the ID.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands/td-p/9645688" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands/td-p/9645688&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;後、ブログ紹介してくれてありがとう。&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 01:57:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656444#M11147</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2020-07-27T01:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656537#M11148</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi Kandennti-San,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;... &lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;you work extremely hard&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; on this forum! :)... so hard that others have become a &lt;FONT color="#800080"&gt;&lt;EM&gt;&lt;STRONG&gt;little bit lazy&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;.&lt;BR /&gt;Regarding the code... &lt;FONT color="#339966"&gt;&lt;EM&gt;&lt;STRONG&gt;it is excellent&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, but there is a more straightforward way to perform the task. I am sure that you know it!&lt;/P&gt;&lt;P&gt;Do you give the chance to find the way by &lt;EM&gt;&lt;STRONG&gt;Mr. Reisyu&lt;/STRONG&gt;&lt;/EM&gt; himself? :).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 02:56:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656537#M11148</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2020-07-27T02:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656578#M11149</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239"&gt;@MichaelT_123&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was dimly aware that some people were not happy with my methods.&lt;BR /&gt;I am grateful for this, as no one has ever come along to warn me as clearly as you have.&lt;BR /&gt;I will change my style in the future.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 04:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9656578#M11149</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2020-07-27T04:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9657483#M11150</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239"&gt;@MichaelT_123&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I found the ConstructionPlaneInput.setByDistanceOnPath Method. I'm going to create a point of intersection between this plane and the path&lt;BR /&gt;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-46dd5f0a-e384-4707-b431-37c0e596f328" target="_blank" rel="noopener"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-46dd5f0a-e384-4707-b431-37c0e596f328&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:10:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9657483#M11150</guid>
      <dc:creator>reisyu</dc:creator>
      <dc:date>2020-07-27T14:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9657501#M11151</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was surprised to see a solution like this.&lt;BR /&gt;Fusion360's APIs are very deep !!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:16:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9657501#M11151</guid>
      <dc:creator>reisyu</dc:creator>
      <dc:date>2020-07-27T14:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9667610#M11152</link>
      <description>&lt;P&gt;I created point along path in the following way.&lt;/P&gt;&lt;P&gt;Create a plane with&amp;nbsp;&lt;SPAN&gt;ConstructionPlaneInput.setByDistanceOnPath Method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add a sketch to this plane.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Create the intersection of the sketch plane and the path using&amp;nbsp;Sketch.intersectWithSketchPlane Method.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Get the crvPath.
        sketch1 = rootComp.sketches.item(0)
        crvPath = sketch1.sketchCurves.sketchFittedSplines.item(0)

        # Get construction planes
        planes = rootComp.constructionPlanes
        
        # Create construction plane input
        planeInput = planes.createInput()

        # Add construction plane by distance on path
        distance = adsk.core.ValueInput.createByReal(0.5)
        planeInput.setByDistanceOnPath(crvPath, distance)
        plane = planes.add(planeInput)

        # Add NewSketch
        sketch2 = rootComp.sketches.add(plane)

        # intersect With Sketch Plane
        entities = []
        entities.append(crvPath)
        skPoints = sketch2.intersectWithSketchPlane(entities)
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reisyu_0-1596288892363.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/802115i86EC6106D5189082/image-size/medium?v=v2&amp;amp;px=400" role="button" title="reisyu_0-1596288892363.png" alt="reisyu_0-1596288892363.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 13:41:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9667610#M11152</guid>
      <dc:creator>reisyu</dc:creator>
      <dc:date>2020-08-01T13:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9667924#M11153</link>
      <description>&lt;DIV class="ui-tabs ui-widget ui-widget-content ui-corner-all"&gt;&lt;DIV class="api-code ui-tabs-panel ui-widget-content ui-corner-bottom"&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi Mr. Reisyu,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... the code is &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;much simpler&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; than the original proposal.&lt;/P&gt;&lt;P&gt;It can be simplified even more, and even, it will be likely faster by avoiding:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;sketch2.intersectWithSketchPlane(entities)&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just use:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;point3D = constructionPlane.geometry.origin&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 01 Aug 2020 23:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9667924#M11153</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2020-08-01T23:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9672361#M11154</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239"&gt;@MichaelT_123&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for the very good advice!&lt;BR /&gt;Combined with sketchPoints.add(poind3D), it's a very simple way to do it!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reisyu_0-1596554522601.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/803178i5A03596EC3CE1A88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="reisyu_0-1596554522601.png" alt="reisyu_0-1596554522601.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 15:22:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/9672361#M11154</guid>
      <dc:creator>reisyu</dc:creator>
      <dc:date>2020-08-04T15:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is Point Along Path not available from the API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/12873103#M11155</link>
      <description>&lt;P&gt;To be fair, point along path is not really available in API. There is a substitute approach where you can use plane along the path and then use sketches to do points on it, but this just adds another layer of complexity and I'm actually bit surprised they have decided not to make it into the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes it is possible to place points on the path using setByPoint, but this requires the whole design to be direct design. Very unfortunate, as I actually would like to keep it parametric. So creating planes and sketches to get points it is. Or using the approach to run text commands, but that would require looking up created points in the app, so that's also cumbersome :/.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 07:36:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-point-along-path-not-available-from-the-api/m-p/12873103#M11155</guid>
      <dc:creator>marekveg</dc:creator>
      <dc:date>2024-07-02T07:36:30Z</dc:date>
    </item>
  </channel>
</rss>

