<?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: [Missing?] API for creating a sketch using a profile as its reference plane in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10251814#M9062</link>
    <description>&lt;P&gt;This is a bug in the API. If it's supported when using the UI in Fusion, the API should also support it.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Apr 2021 20:45:54 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2021-04-19T20:45:54Z</dc:date>
    <item>
      <title>[Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10246263#M9057</link>
      <description>&lt;P&gt;In Fusion 360 UI, we can create a sketch using a &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-bc8dd363-a672-415b-a1b1-13c88b138e13" target="_blank" rel="noopener"&gt;ConstructionPlane&lt;/A&gt;, planar &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-1d41bd0a-3810-45e5-b4ce-4003123685d8" target="_blank" rel="noopener"&gt;BRepFace&lt;/A&gt; or &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c9979c8d-a239-4ced-a6d7-93db7ffdf712" target="_blank" rel="noopener"&gt;Profile&lt;/A&gt; as its referencePlane. But it seems if we use a &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c9979c8d-a239-4ced-a6d7-93db7ffdf712" target="_blank" rel="noopener"&gt;Profile&lt;/A&gt; as the planarEntity argument of&amp;nbsp;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-03aaecb6-9447-41c5-aabe-804e44cb9aaa" target="_blank" rel="noopener"&gt;Sketches.add Method&lt;/A&gt; , the method returns nullptr (in C++). Also using a Profile for setting&amp;nbsp;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-9d3a3278-3ab3-498d-9a44-ed0d02238296" target="_blank" rel="noopener"&gt;Sketch.referencePlane Property&lt;/A&gt;&amp;nbsp;simply does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason for this difference between the UI and the API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we use UI to create a sketch using a Profile, the objectType of referencePlane property will be returened as "adsk::fusion::Profile" using API (as expected).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 06:37:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10246263#M9057</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-04-17T06:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249172#M9058</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2799701"&gt;@nnikbin&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's python, but I didn't have any problems.&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
        app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        design = adsk.fusion.Design.cast(app.activeProduct)
        rootComp = design.rootComponent

        # Create sketch
        sketches = rootComp.sketches
        sketch = sketches.add(rootComp.xZConstructionPlane)
        sketchCircles = sketch.sketchCurves.sketchCircles
        centerPoint = adsk.core.Point3D.create(0, 0, 0)
        sketchCircles.addByCenterRadius(centerPoint, 3.0)

        # Create a sketch using Profile
        prof = sketch.profiles.item(0)
        sketches.add(prof.parentSketch.referencePlane)
        sketches.addWithoutEdges(prof.parentSketch.referencePlane)

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Apr 2021 02:41:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249172#M9058</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-04-19T02:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249274#M9059</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;Thank you for your reply. In your script you create a sketch using the referencePlane of profile's parent sketch as the planar entity. What I am looking for is to create a sketch using a Profile as its referencePlane. As you know in 3D sketches it is possible to have profiles that are not aligned with their parent sketch's plane.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that we can create construction planes aligned with the profile, then create a sketch using them, but I was wondering why the API does not accept Profiles as referencePlanes, while the UI accept them.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 04:11:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249274#M9059</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-04-19T04:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249569#M9060</link>
      <description>&lt;P&gt;Sorry, I hadn't thought about 3D sketch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The API does not support it, so I thought of another way.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def run(context):
    ・・・
    skt :adsk.fusion.Sketch = createSketchFromProfile(prof)
    ・・・

def createSketchFromProfile(
    prof :adsk.fusion.Profile) -&amp;gt; adsk.fusion.Sketch:

    app = adsk.core.Application.get()
    ui = app.userInterface
    des = adsk.fusion.Design.cast(app.activeProduct)
    skts = des.activeComponent.sketches
    sktsCount = skts.count

    sels = ui.activeSelections
    sels.clear()
    sels.add(prof)

    app.executeTextCommand(u'NaFusionUI.SketchCreateCmd')
    app.executeTextCommand(u'NaFusionUI.SketchStopCmd')

    if sktsCount + 1 == skts.count:
        return skts[-1]
    else:
        return adsk.fusion.Sketch.cast(None)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 07:16:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10249569#M9060</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-04-19T07:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10251566#M9061</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&amp;nbsp;. Your solution works fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not just click on "Accept Solution" button because I want to wait to hopefully get the answer to my main question. Then I accept both answers as solutions.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 19:27:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10251566#M9061</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-04-19T19:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10251814#M9062</link>
      <description>&lt;P&gt;This is a bug in the API. If it's supported when using the UI in Fusion, the API should also support it.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 20:45:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10251814#M9062</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2021-04-19T20:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: [Missing?] API for creating a sketch using a profile as its reference plane</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10252118#M9063</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&amp;nbsp;for your reply. In this case the API documentation matches the API behavior so after solving the issue the documents need to be edited.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As it seems that there is no public list for reporting bugs, what is the best way to make sure the bugs that are reported in the forum and marked as "Solved" (because of a workaround or confirmation) will be reported?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 00:00:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/missing-api-for-creating-a-sketch-using-a-profile-as-its/m-p/10252118#M9063</guid>
      <dc:creator>nnikbin</dc:creator>
      <dc:date>2021-04-20T00:00:34Z</dc:date>
    </item>
  </channel>
</rss>

