<?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 Sketch profiles added in random order in Fusion Support Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120284#M132454</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The oct 2019 update includes a fix for missing profiles:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/profiles-disappear-from-3d-sketch/m-p/9087505#M8614" target="_blank"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/profiles-disappear-from-3d-sketch/m-p/9087505#M8614&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;Now I think there is a new error: &lt;STRONG&gt;The sketch profiles is added in seemingly random order.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To illustrate the problem, I draw two spheres by revolving profiles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import adsk.core, adsk.fusion, math

app = adsk.core.Application.get()
doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
root = app.activeProduct.rootComponent

sketch = root.sketches.add(root.xYConstructionPlane)
arcs = sketch.sketchCurves.sketchArcs
lines = sketch.sketchCurves.sketchLines
revolves = root.features.revolveFeatures

#First sphere 
arc = arcs.addByCenterStartSweep(adsk.core.Point3D.create(10, 4, 2), adsk.core.Point3D.create(9, 4, 2), math.pi)
axisLine = lines.addByTwoPoints(adsk.core.Point3D.create(9, 4, 2), adsk.core.Point3D.create(11, 4, 2))
print(sketch.profiles.count)
profile = sketch.profiles.item(0)
revInput = revolves.createInput(profile, axisLine, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
revInput.setAngleExtent(False, adsk.core.ValueInput.createByReal(2*math.pi))
revolves.add(revInput)

#Second sphere
arc = arcs.addByCenterStartSweep(adsk.core.Point3D.create(0, 2, 1), adsk.core.Point3D.create(-2, 2, 1), math.pi)
axisLine = lines.addByTwoPoints(adsk.core.Point3D.create(-2, 2, 1), adsk.core.Point3D.create(2, 2, 1))
print(sketch.profiles.count)
profile = sketch.profiles.item(0)  #This is wrong!!
revInput = revolves.createInput(profile, axisLine, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
revInput.setAngleExtent(False, adsk.core.ValueInput.createByReal(2*math.pi))
revolves.add(revInput)&lt;/PRE&gt;&lt;P&gt;Notice, that the second sphere also uses&lt;/P&gt;&lt;PRE&gt;sketch.profiles.item(0)&lt;/PRE&gt;&lt;P&gt;This is should be&lt;/P&gt;&lt;PRE&gt;sketch.profiles.item(1)&lt;/PRE&gt;&lt;P&gt;as there has just been added a profile.&lt;/P&gt;&lt;P&gt;I have tried with 100 randomly generated profiles(spheres), and I can not see any pattern in when the profile is added to the beginning or end of&amp;nbsp;sketch.profiles !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;Output(correct) of the above(wrong) code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShot2019-10-31T174548@1X.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/693434iD56F3DB90ADFBE2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScreenShot2019-10-31T174548@1X.png" alt="ScreenShot2019-10-31T174548@1X.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the code is corrected, the output is wrong:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShot2019-10-31T174802@1X.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/693435i87446C2A1D8A6254/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScreenShot2019-10-31T174802@1X.png" alt="ScreenShot2019-10-31T174802@1X.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 16:54:01 GMT</pubDate>
    <dc:creator>hpekristiansen</dc:creator>
    <dc:date>2019-10-31T16:54:01Z</dc:date>
    <item>
      <title>Sketch profiles added in random order</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120284#M132454</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The oct 2019 update includes a fix for missing profiles:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/profiles-disappear-from-3d-sketch/m-p/9087505#M8614" target="_blank"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/profiles-disappear-from-3d-sketch/m-p/9087505#M8614&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;Now I think there is a new error: &lt;STRONG&gt;The sketch profiles is added in seemingly random order.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To illustrate the problem, I draw two spheres by revolving profiles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import adsk.core, adsk.fusion, math

app = adsk.core.Application.get()
doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
root = app.activeProduct.rootComponent

sketch = root.sketches.add(root.xYConstructionPlane)
arcs = sketch.sketchCurves.sketchArcs
lines = sketch.sketchCurves.sketchLines
revolves = root.features.revolveFeatures

#First sphere 
arc = arcs.addByCenterStartSweep(adsk.core.Point3D.create(10, 4, 2), adsk.core.Point3D.create(9, 4, 2), math.pi)
axisLine = lines.addByTwoPoints(adsk.core.Point3D.create(9, 4, 2), adsk.core.Point3D.create(11, 4, 2))
print(sketch.profiles.count)
profile = sketch.profiles.item(0)
revInput = revolves.createInput(profile, axisLine, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
revInput.setAngleExtent(False, adsk.core.ValueInput.createByReal(2*math.pi))
revolves.add(revInput)

#Second sphere
arc = arcs.addByCenterStartSweep(adsk.core.Point3D.create(0, 2, 1), adsk.core.Point3D.create(-2, 2, 1), math.pi)
axisLine = lines.addByTwoPoints(adsk.core.Point3D.create(-2, 2, 1), adsk.core.Point3D.create(2, 2, 1))
print(sketch.profiles.count)
profile = sketch.profiles.item(0)  #This is wrong!!
revInput = revolves.createInput(profile, axisLine, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
revInput.setAngleExtent(False, adsk.core.ValueInput.createByReal(2*math.pi))
revolves.add(revInput)&lt;/PRE&gt;&lt;P&gt;Notice, that the second sphere also uses&lt;/P&gt;&lt;PRE&gt;sketch.profiles.item(0)&lt;/PRE&gt;&lt;P&gt;This is should be&lt;/P&gt;&lt;PRE&gt;sketch.profiles.item(1)&lt;/PRE&gt;&lt;P&gt;as there has just been added a profile.&lt;/P&gt;&lt;P&gt;I have tried with 100 randomly generated profiles(spheres), and I can not see any pattern in when the profile is added to the beginning or end of&amp;nbsp;sketch.profiles !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##################&lt;/P&gt;&lt;P&gt;Output(correct) of the above(wrong) code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShot2019-10-31T174548@1X.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/693434iD56F3DB90ADFBE2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScreenShot2019-10-31T174548@1X.png" alt="ScreenShot2019-10-31T174548@1X.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the code is corrected, the output is wrong:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScreenShot2019-10-31T174802@1X.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/693435i87446C2A1D8A6254/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScreenShot2019-10-31T174802@1X.png" alt="ScreenShot2019-10-31T174802@1X.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 16:54:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120284#M132454</guid>
      <dc:creator>hpekristiansen</dc:creator>
      <dc:date>2019-10-31T16:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch profiles added in random order</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120762#M132455</link>
      <description>&lt;P&gt;I don't know the specific internals of how profiles are being calculated, but I don't think you should expect any kind of order or consistency in the order when they're returned.&amp;nbsp; The only thing you should expect is that a list of the current profiles that can be calculated from the sketch and nothing more.&amp;nbsp; If you need to know which profile goes with specific sketch geometry, you'll need to do the work to find the match.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 20:29:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120762#M132455</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-10-31T20:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch profiles added in random order</title>
      <link>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120962#M132456</link>
      <description>&lt;P&gt;I am very surprised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before the bug correction, I could generate 100 different spheres by using only&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;profile = sketch.profiles.item(0)&lt;/PRE&gt;&lt;P&gt;for all of them as all new profiles outside of the sketch plane was overwriting the first profiles item.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now new profiles are added randomly to the start or end of profiles. &lt;STRONG&gt;-the situation is worse than ever.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#################&lt;/P&gt;&lt;P&gt;The "Extrude Feature API Sample API Sample" :&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-CB1A2357-C8CD-474D-921E-992CA3621D04" target="_blank"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-CB1A2357-C8CD-474D-921E-992CA3621D04&lt;/A&gt;&lt;/P&gt;&lt;P&gt;uses&lt;/P&gt;&lt;PRE&gt;sketch.profiles.item(0)   and
sketch.profiles.item(1)&lt;/PRE&gt;&lt;P&gt;for extrusion, so it among many other scripts is depended on the order of profiles. The only reason this example does not fail is because the profiles are on the sketch plane or by pure luck!?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 23:02:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-support-forum/sketch-profiles-added-in-random-order/m-p/9120962#M132456</guid>
      <dc:creator>hpekristiansen</dc:creator>
      <dc:date>2019-10-31T23:02:04Z</dc:date>
    </item>
  </channel>
</rss>

