<?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: Flip the direction of distance dimension in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8853514#M14198</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have the exact same issue though it is happening to me when using the UI and not programatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The quality of the video is low so i'm including the fusion 360 file so it can be tested on your own.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://youtu.be/qGlUmNBdNIs" target="_blank" rel="nofollow noopener noreferrer"&gt;https://youtu.be/qGlUmNBdNIs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When editing d33, d44 inverts visually though nothing is changed in its parameter value. It can be fixed by changing d44 to a negative number, then back to a positive number. This has to be done every time&amp;nbsp;d33 is edited.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jun 2019 16:15:38 GMT</pubDate>
    <dc:creator>us.shadow.op</dc:creator>
    <dc:date>2019-06-15T16:15:38Z</dc:date>
    <item>
      <title>Flip the direction of distance dimension</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8782878#M14194</link>
      <description>&lt;P&gt;I'm writing a Python script to generate components for me. I first create new sketch points roughly where they're going to be and then constrain them properly. However, one distance dimension for a line length keeps flipping the points of the line around.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please take a look at the attachments to see what I mean. Both sketches are identical in their constraints and dimensions. As long as I don't add the dimension to the horizontal line the correct orientation is with the diagonal lines on the right side. However once I add a dimension, the two end points of the line swap places and thus the whole sketch flips.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;horizontal = lines.addByTwoPoints(point(5, 0), point(-5, 0))
horizontal.isConstruction = True
constraints.addHorizontal(horizontal)
constraints.addMidPoint(sketch.originPoint, horizontal)&lt;BR /&gt;
dimensions.addDistanceDimension(horizontal.startSketchPoint, horizontal.endSketchPoint, adsk.fusion.DimensionOrientations.HorizontalDimensionOrientation, point(1, 1)).parameter._set_expression(str(referenceDiameterGear))&lt;/PRE&gt;
&lt;P&gt;This is the code with which I add the horizontal line and its dimensions. I have also tried swapping the places of startSketchPoint and endSketchPoint, but that doesn't change anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I make sure these points aren't being flipped after adding the dimension? The same problem also occurred to me occasionally while manually creating sketches and I couldn't figure out how to deal with it manually either.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 10:04:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8782878#M14194</guid>
      <dc:creator>Padarom</dc:creator>
      <dc:date>2019-05-10T10:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Flip the direction of distance dimension</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8790261#M14195</link>
      <description>&lt;P&gt;We tried with below script but unable to reproduced it. Let me know If anything is missing in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;app = adsk.core.Application.get()&lt;/P&gt;
&lt;P&gt;root = app.activeProduct.rootComponent&lt;/P&gt;
&lt;P&gt;sketches = root.sketches&lt;/P&gt;
&lt;P&gt;sketch = sketches.add(root.xYConstructionPlane)&lt;/P&gt;
&lt;P&gt;lines = sketch.sketchCurves.sketchLines&lt;/P&gt;
&lt;P&gt;pt1 = adsk.core.Point3D.create(5,0,0)&lt;/P&gt;
&lt;P&gt;pt2 = adsk.core.Point3D.create(-5,0,0)&lt;/P&gt;
&lt;P&gt;horizontal = lines.addByTwoPoints(pt1,pt2)&lt;/P&gt;
&lt;P&gt;horizontal.isConstruction = True&lt;/P&gt;
&lt;P&gt;constraints = sketch.geometricConstraints&lt;/P&gt;
&lt;P&gt;constraints.addHorizontal(horizontal)&lt;/P&gt;
&lt;P&gt;constraints.addMidPoint(sketch.originPoint, horizontal)&lt;/P&gt;
&lt;P&gt;dimensions = sketch.sketchDimensions&lt;/P&gt;
&lt;P&gt;dimensions.addDistanceDimension(horizontal.startSketchPoint, horizontal.endSketchPoint, adsk.fusion.DimensionOrientations.HorizontalDimensionOrientation, adsk.core.Point3D.create(1,1,0))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way what version of Fusion you noticed this issue?&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 15:04:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8790261#M14195</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2019-05-14T15:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Flip the direction of distance dimension</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8791122#M14196</link>
      <description>&lt;P&gt;I'm sorry, I didn't think to include a full reproducible example, I just grabbed the part of the code that was relevant to this single dimension. I am using Fusion 360 2.0.5688&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;point = lambda x, y : adsk.core.Point3D.create(x, y, 0)
newOccurrence = occurrences.addNewComponent(matrix)
newComponent = adsk.fusion.Component.cast(newOccurrence.component)
sketches = newComponent.sketches

xzPlane = newComponent.xZConstructionPlane
sketch = sketches.add(xzPlane)

lines = sketch.sketchCurves.sketchLines
constraints = sketch.geometricConstraints
dimensions = sketch.sketchDimensions

vertical = lines.addByTwoPoints(point(0, 5), point(0, -5))
vertical.isConstruction = True
constraints.addVertical(vertical)
constraints.addMidPoint(sketch.originPoint, vertical)

horizontal = lines.addByTwoPoints(point(5, 0), point(-5, 0))
horizontal.isConstruction = True
constraints.addHorizontal(horizontal)
constraints.addMidPoint(sketch.originPoint, horizontal)
dimensions.addDistanceDimension(horizontal.startSketchPoint, horizontal.endSketchPoint, adsk.fusion.DimensionOrientations.HorizontalDimensionOrientation, point(-1, -1)).parameter._set_expression(str(referenceDiameterGear))

rootCone = lines.addByTwoPoints(vertical.endSketchPoint, horizontal.endSketchPoint)
rootCone.isConstruction = True
dimensions.addAngularDimension(vertical, rootCone, point(1, 0)).parameter._set_expression(str(referenceConeAngleGear) + " deg")&lt;/PRE&gt;
&lt;P&gt;The expected shape is a cross with the top and right point connected via a construction line (rootCone). What it ends up as is however the bottom and left point being connected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The angular dimension of rootCone doesn't have anything to do with the horizontal line flipping. I did manage to circumvent the issue by connecting rootCone to horizontal.startSketchPoint (rather than endSketchPoint), but that's only a solution in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I add this piece of code I have the exact same issue, but can't solve it with the solution above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;backConeAddendum = lines.addByTwoPoints(backCone.startSketchPoint, point(0, 0))
constraints.addCollinear(backConeAddendum, backCone)
dimensions.addDistanceDimension(backConeAddendum.endSketchPoint, backCone.startSketchPoint, adsk.fusion.DimensionOrientations.AlignedDimensionOrientation, point(1, 1)).parameter._set_expression(str(addendumGear))&lt;/PRE&gt;
&lt;P&gt;See attachments. CaptureRight is what I'd expect to see, CaptureWrong is what it ends up as.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 21:18:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8791122#M14196</guid>
      <dc:creator>Padarom</dc:creator>
      <dc:date>2019-05-14T21:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Flip the direction of distance dimension</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8853511#M14197</link>
      <description>&lt;P&gt;same thing happening to me, i'll post details to person researching the issue.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 16:16:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8853511#M14197</guid>
      <dc:creator>us.shadow.op</dc:creator>
      <dc:date>2019-06-15T16:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Flip the direction of distance dimension</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8853514#M14198</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have the exact same issue though it is happening to me when using the UI and not programatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The quality of the video is low so i'm including the fusion 360 file so it can be tested on your own.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://youtu.be/qGlUmNBdNIs" target="_blank" rel="nofollow noopener noreferrer"&gt;https://youtu.be/qGlUmNBdNIs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When editing d33, d44 inverts visually though nothing is changed in its parameter value. It can be fixed by changing d44 to a negative number, then back to a positive number. This has to be done every time&amp;nbsp;d33 is edited.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 16:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/flip-the-direction-of-distance-dimension/m-p/8853514#M14198</guid>
      <dc:creator>us.shadow.op</dc:creator>
      <dc:date>2019-06-15T16:15:38Z</dc:date>
    </item>
  </channel>
</rss>

