<?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: Merge Points in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3764745#M132655</link>
    <description>&lt;P&gt;Thanks for that Thomas; however it seems that I'm getting the same error: Run-time error 438: Object doesn't support this property or method. And your sample seems to be doing essentially the same as mine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it might be a problem with the version: we're using 2010, but i fired up 2012 and it's the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't acutally mention that I'm running this from Excel;&amp;nbsp;I have included as references Autodesk Inventor Compatibility Host 1.0; Autodesk Inventor Object Library and Autodesk Inventor's Apprentice Object Library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything else I might have missed?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jan 2013 01:10:49 GMT</pubDate>
    <dc:creator>robmatthews</dc:creator>
    <dc:date>2013-01-30T01:10:49Z</dc:date>
    <item>
      <title>Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3761203#M132653</link>
      <description>&lt;P&gt;Why does this code fragment not work? (Within an active part sketch, with some sketched geometry.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just trying to close the loops to have valid extrusion profiles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Dim iCounter As Integer
        Dim icounter2 As Integer
        Dim oSPoint1 As SketchPoint
        Dim oSPoint2 As SketchPoint
        Dim xVal1 As Double
        Dim xVal2 As Double
        Dim yVal1 As Double
        Dim yVal2 As Double
        For iCounter = 1 To oSketch.SketchPoints.Count
            For icounter2 = 2 To oSketch.SketchPoints.Count
                If iCounter &amp;lt;&amp;gt; icounter2 Then
                    xVal1 = oSketch.SketchPoints(iCounter).Geometry.X
                    xVal2 = oSketch.SketchPoints(icounter2).Geometry.X
                    yVal1 = oSketch.SketchPoints(iCounter).Geometry.Y
                    yVal2 = oSketch.SketchPoints(icounter2).Geometry.Y
                    If xVal1 = xVal2 Then
                        If yVal1 = yVal2 Then
                            Set oSPoint1 = oSketch.SketchPoints(iCounter)
                            Set oSPoint2 = oSketch.SketchPoints(icounter2)
                            oSPoint1.Merge (oSPoint2)
                                                    End If
                    End If
                End If
            Next
        Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2013 23:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3761203#M132653</guid>
      <dc:creator>robmatthews</dc:creator>
      <dc:date>2013-01-24T23:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3761392#M132654</link>
      <description>&lt;P&gt;I had a similar problem after I imported an autocad file into a sketch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I'm using :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim StartCounter As Integer
		Dim PointItemMaster As SketchPoint
		Dim PointItemClient As SketchPoint
		
		For Each PointItemMaster In oSketch.SketchPoints
			StartCounter = 0
			For Each PointItemClient In oSketch.SketchPoints
				If Round(PointItemClient.Geometry.x,4) = Round(PointItemMaster.Geometry.x,4) And Round(PointItemClient.Geometry.y,4) = Round(PointItemMaster.Geometry.y,4) Then
					StartCounter = StartCounter + 1
					
					If StartCounter = 2 Then
						PointItemMaster.Merge(PointItemClient)
						StartCounter = 0
						Exit For
					End If
				End If
			Next PointItemClient
		Next PointItemMaster&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to round the sketchpoints X/Y to 4 decimal places for it to work, when I dumped the co-ordinates out I found some were&amp;nbsp;&lt;SPAN&gt;0.000000000000001mm out - 4 decimal places was accurate enough for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2013 09:13:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3761392#M132654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-25T09:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3764745#M132655</link>
      <description>&lt;P&gt;Thanks for that Thomas; however it seems that I'm getting the same error: Run-time error 438: Object doesn't support this property or method. And your sample seems to be doing essentially the same as mine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it might be a problem with the version: we're using 2010, but i fired up 2012 and it's the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't acutally mention that I'm running this from Excel;&amp;nbsp;I have included as references Autodesk Inventor Compatibility Host 1.0; Autodesk Inventor Object Library and Autodesk Inventor's Apprentice Object Library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything else I might have missed?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 01:10:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3764745#M132655</guid>
      <dc:creator>robmatthews</dc:creator>
      <dc:date>2013-01-30T01:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3764924#M132656</link>
      <description>&lt;P&gt;Hmm OK so your issue isn't with the Merge() method failing because of tolerances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At what line does your code fail?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2013 10:51:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3764924#M132656</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-30T10:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3765678#M132657</link>
      <description>&lt;P&gt;It fails at the PointItemMaster.Merge(PointItemClient) (or the equivalent in my code).&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2013 02:32:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3765678#M132657</guid>
      <dc:creator>robmatthews</dc:creator>
      <dc:date>2013-01-31T02:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3768385#M132658</link>
      <description>&lt;P&gt;I got the points to become coincident by starting one entity from the endpoint of the previous entity, rather than from the Transient Geometry point2d that they share, to wit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call oSketchBlockDef.SketchArcs.AddByCenterStartEndPoint(Coords(7), Coords(3), Coords(6), True)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call oSketchBlockDef.SketchArcs.AddByCenterStartEndPoint(Coords(8), Coords(4), Coords(5), False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call oSketchBlockDef.SketchLines.AddByTwoPoints(oSketchBlockDef.SketchArcs(1).StartSketchPoint, oSketchBlockDef.SketchArcs(2).EndSketchPoint)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call oSketchBlockDef.SketchLines.AddByTwoPoints(oSketchBlockDef.SketchArcs(2).StartSketchPoint, oSketchBlockDef.SketchArcs(1).EndSketchPoint)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I drew the two end arcs, and then they two connecting lines;&amp;nbsp;I could equally have stepped my way round the keyway.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This closed the loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2013 23:25:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3768385#M132658</guid>
      <dc:creator>robmatthews</dc:creator>
      <dc:date>2013-02-03T23:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3768558#M132659</link>
      <description>&lt;P&gt;I was thinking not merging but adding coincident constraints between the two points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cean&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 04:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3768558#M132659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-04T04:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Points</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3770284#M132660</link>
      <description>&lt;P&gt;cean_au,&lt;/P&gt;
&lt;P&gt;You have to use Merge method&amp;nbsp; to replace two sketch points by one point. This is the Sketch API requirement.&lt;/P&gt;
&lt;P&gt;If you create coincident constraint between the ends of two lines, endpoints are merged in the background automatically. You may easily verify his fact checking SketchPoints.Count property before and after coincident operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2013 21:40:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/merge-points/m-p/3770284#M132660</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2013-02-05T21:40:14Z</dc:date>
    </item>
  </channel>
</rss>

