<?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: Moving a sketch circle tangent too two projected arcs in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12100010#M3275</link>
    <description>&lt;P&gt;Yes this worked.&amp;nbsp; Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 16:36:46 GMT</pubDate>
    <dc:creator>rusty.bird</dc:creator>
    <dc:date>2023-07-13T16:36:46Z</dc:date>
    <item>
      <title>Moving a sketch circle tangent too two projected arcs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12099722#M3273</link>
      <description>&lt;P&gt;I made a script to move a sketched circle tangent between two projected arcs but it is not moving when I run it.&amp;nbsp; Can anybody help me figure out why its not working properly?&amp;nbsp; &amp;nbsp;I have attached some pictures and the file aswell.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my script:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	// Prompt the user to select a plane.
	Ptr&amp;lt;Selection&amp;gt; selection1 = ui-&amp;gt;selectEntity("Select a Face On the Rolls", "Faces");
	Ptr&amp;lt;BRepFace&amp;gt; plane1 = selection1-&amp;gt;entity();

	// Get the selected face and create a sketch on it
	Ptr&amp;lt;Sketches&amp;gt; skt = rootComp-&amp;gt;sketches();
	Ptr&amp;lt;Sketch&amp;gt; skt1 = skt-&amp;gt;addWithoutEdges(plane1);

	Ptr&amp;lt;SketchCurves&amp;gt; curves = skt1-&amp;gt;sketchCurves();

	Ptr&amp;lt;SketchCircles&amp;gt; circles = curves-&amp;gt;sketchCircles();

	// Create a circle with a diameter
	Ptr&amp;lt;SketchCircle&amp;gt; circle1 = circles-&amp;gt;addByCenterRadius(Point3D::create(0, -30, 0), 20);
	if (!circle1)
		return false;

	Ptr&amp;lt;SketchDimensions&amp;gt; dims = skt1-&amp;gt;sketchDimensions();

	// Add the dimension to the circle
	Ptr&amp;lt;SketchDimension&amp;gt; dim1 = dims-&amp;gt;addDiameterDimension(circle1, adsk::core::Point3D::create(0, 0, 0));
	if (!dim1)
		return false;

	// Prompt the user to select a bRepEdge.
	Ptr&amp;lt;Selection&amp;gt; selection2 = ui-&amp;gt;selectEntity("Select The Round Edge On A Roll", "Edges");
	Ptr&amp;lt;BRepEdge&amp;gt; edge1 = selection2-&amp;gt;entity();

	Ptr&amp;lt;SketchCurve&amp;gt; proj1;
	proj1 = skt1-&amp;gt;project(edge1);

	// Prompt the user to select another bRepEdge.
	Ptr&amp;lt;Selection&amp;gt; selection3 = ui-&amp;gt;selectEntity("Select The Other Round Edge On A Roll", "Edges");
	Ptr&amp;lt;BRepEdge&amp;gt; edge2 = selection3-&amp;gt;entity();

	Ptr&amp;lt;SketchCurve&amp;gt; proj2;
	proj2 = skt1-&amp;gt;project(edge2);

	Ptr&amp;lt;GeometricConstraints&amp;gt; constraints = skt1-&amp;gt;geometricConstraints();

	Ptr&amp;lt;GeometricConstraint&amp;gt; tanCon1 = constraints-&amp;gt;addTangent(circle1, proj1);
	if (!tanCon1)
		return false;

	Ptr&amp;lt;GeometricConstraint&amp;gt; tanCon2 = constraints-&amp;gt;addTangent(circle1, proj2);
	if (!tanCon2)
		return false;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 14:45:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12099722#M3273</guid>
      <dc:creator>rusty.bird</dc:creator>
      <dc:date>2023-07-13T14:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Moving a sketch circle tangent too two projected arcs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12099889#M3274</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your problem is with variables proj1 and proj2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sentence:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;proj1 = skt1-&amp;gt;project(edge1);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;returns an ObjectCollection and you are expecting a SketchCurve as the proj1 variable was declared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to change this sentence by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;proj1 = skt1-&amp;gt;project(edge1)-&amp;gt;item(0);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same fix need to be made for proj2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It solved the problem in my tests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Jorge Jaramillo&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 00:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12099889#M3274</guid>
      <dc:creator>Jorge_Jaramillo</dc:creator>
      <dc:date>2023-08-17T00:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Moving a sketch circle tangent too two projected arcs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12100010#M3275</link>
      <description>&lt;P&gt;Yes this worked.&amp;nbsp; Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 16:36:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/moving-a-sketch-circle-tangent-too-two-projected-arcs/m-p/12100010#M3275</guid>
      <dc:creator>rusty.bird</dc:creator>
      <dc:date>2023-07-13T16:36:46Z</dc:date>
    </item>
  </channel>
</rss>

