<?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: Sizing problem when performing a coincident constraint in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10381343#M8688</link>
    <description>&lt;P&gt;If you want the line to remain exactly where it was before adding the coincident constraints, I think the best solution is to fix both endpoints of the line.&amp;nbsp; You can do that with something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;line.startSketchPoint.isFixed = True
line.endSketchPoint.isFixed = True&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 11 Jun 2021 02:57:54 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2021-06-11T02:57:54Z</dc:date>
    <item>
      <title>Sizing problem when performing a coincident constraint</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10374042#M8686</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like help with the following problem.&lt;BR /&gt;I want to include a spline inside a sketch that already contains a line, and make two constraints: the first with the first point of the line and the spline, and the second, between the end point of the line and the middle of the spline.&lt;BR /&gt;But I encounter the problem of a line dimension error after the constraints (decreasing its size).&lt;BR /&gt;Here's the code and photo of the error found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note 1: I really need to insert the spline in the sketch, as this is just a test for another application, where it is necessary to perform this operation.&lt;/P&gt;&lt;P&gt;Note 2: I need the line to remain the same 8 cm as it initially has.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;BR /&gt;Vitor Urel&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 19:09:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10374042#M8686</guid>
      <dc:creator>vitor.carneiro</dc:creator>
      <dc:date>2021-06-08T19:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sizing problem when performing a coincident constraint</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10375649#M8687</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10083760"&gt;@vitor.carneiro&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about adding a DistanceDimension in advance?&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# Fusion360API Python script
import adsk.core, adsk.fusion, traceback

def run(context):
    ui = adsk.core.UserInterface.cast(None)
    try:
        app :adsk.fusion.Application = adsk.core.Application.get()
        ui = app.userInterface
        des :adsk.fusion.Design = app.activeProduct
        root :adsk.fusion.Component = des.rootComponent

        sk = root.sketches.add(root.xYConstructionPlane)
        sk1 = root.sketches.add(root.xYConstructionPlane)

        points = adsk.core.ObjectCollection.create()
        pnts = [
            [0,0,0],
            [5,1,0],
            [6,4,0],
            [7,6,0],
            [2,3,0],
            [0,1,0],
            ]
        Pnt3D = adsk.core.Point3D
        for p in pnts:
            points.add(Pnt3D.create(p[0],p[1],p[2]))

        spline = sk1.sketchCurves.sketchFittedSplines.add(points)

        spline1 = sk.include(spline)
        spline2 = spline1.item(0)

        line = sk.sketchCurves.sketchLines.addByTwoPoints(
            Pnt3D.create(0,0,0),
            Pnt3D.create(8,0,0)
        )

        # DistanceDimension
        sk.sketchDimensions.addDistanceDimension(
            line.startSketchPoint,
            line.endSketchPoint,
            adsk.fusion.DimensionOrientations.AlignedDimensionOrientation,
            Pnt3D.create(4,1,0))

        sk.geometricConstraints.addCoincident(
            line.startSketchPoint,
            spline2.startSketchPoint
        )

        sk.geometricConstraints.addCoincident(
            line.endSketchPoint,
            spline2
        )

    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="1.png" style="width: 355px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/928187iBA347CB0956A2D18/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 09:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10375649#M8687</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-06-09T09:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sizing problem when performing a coincident constraint</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10381343#M8688</link>
      <description>&lt;P&gt;If you want the line to remain exactly where it was before adding the coincident constraints, I think the best solution is to fix both endpoints of the line.&amp;nbsp; You can do that with something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;line.startSketchPoint.isFixed = True
line.endSketchPoint.isFixed = True&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Jun 2021 02:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sizing-problem-when-performing-a-coincident-constraint/m-p/10381343#M8688</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2021-06-11T02:57:54Z</dc:date>
    </item>
  </channel>
</rss>

