<?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: Break Link changes lines in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368715#M90747</link>
    <description>&lt;P&gt;I do believe your request to be ludicrous.&amp;nbsp; I have already provided the source code, and document, and you provided another copy of the same source code (that runs in full in iLogic), and I tested all of in on the provided document.&amp;nbsp; The result is that the lines move when they shouldn't.&amp;nbsp; They begin in one position before break link command, and end in a completely different position after break link command.&amp;nbsp; I posted an image of the bogus result (yellow lines do not outline the pipe, some have even moved down to the 0 elevation below the pipe.&amp;nbsp; I've been repeating it over and over, would you like a video as well?&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 14:43:57 GMT</pubDate>
    <dc:creator>JamieVJohnson2</dc:creator>
    <dc:date>2018-10-30T14:43:57Z</dc:date>
    <item>
      <title>Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8359976#M90600</link>
      <description>&lt;P&gt;I have the need to break a lot of links created by addsilhouette, and addentity and such to a sketch.&amp;nbsp; After the entities are added to the sketch the lines, arcs, circles, ellipses are all still linked back to the original 3D solid.&amp;nbsp; Running Break Link on over 700 objects cycles through and breaks the link.&amp;nbsp; However approx. 5% of the lines have been moved (where point values get set to 0 or something).&amp;nbsp; I think this may be a bug with Inventor (using version 2019.1.2 build 200).&amp;nbsp; If you break link on these exact lines one by one by hand, it succeeds, if you do so in batch by hand it messes up.&amp;nbsp; If you do so in batch by this code (vb.net), it messes just the same:&lt;/P&gt;&lt;PRE&gt;    Public Sub BreakAllLinks(sketch As Sketch)
        For Each en As SketchEntity In sketch.SketchEntities
            en.Reference = False
        Next
    End Sub&lt;/PRE&gt;&lt;P&gt;My intention is to report this bug, but also is there a way to add these entities without linking in the first place via code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 18:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8359976#M90600</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-10-25T18:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8365247#M90676</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3677112"&gt;@JamieVJohnson2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below iLogic code seems to be working with attached part.&amp;nbsp; All entity links are set to false.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Main()
	Dim oDoc As PartDocument 
	oDoc = ThisApplication.ActiveDocument 
	
	Dim oDef As PartComponentDefinition 
	oDef = oDoc.ComponentDefinition 
	
	Dim oSketch As Sketch 
	oSketch = oDef.Sketches.Item("Sketch5")
	BreakAllLinks(oSketch)
End Sub 
Public Sub BreakAllLinks(sketch As Sketch)
        For Each en As SketchEntity In sketch.SketchEntities
            en.Reference = False
        Next
End Sub&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8365247#M90676</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-10-29T09:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8366927#M90719</link>
      <description>&lt;P&gt;Not for me.&amp;nbsp; Not as iLogic, not as VB.Net, not as user run command.&amp;nbsp; Not with Software Graphics, not with Hardware graphics, (NVIDIA Quadro P5000 16GB card, driver version :397.93) on a Precision 3630 running Windows 10 64Bit Pro for Workstations, and lots of highspeed hardware.&amp;nbsp; I get this instead.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 834px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563171iED426FB89F589F7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 21:13:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8366927#M90719</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-10-29T21:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368052#M90737</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3677112"&gt;@JamieVJohnson2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please provide source code to test? Also please provide&amp;nbsp;expected&amp;nbsp;part after breaking link?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make sure that files are non confidential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 10:18:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368052#M90737</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-10-30T10:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368715#M90747</link>
      <description>&lt;P&gt;I do believe your request to be ludicrous.&amp;nbsp; I have already provided the source code, and document, and you provided another copy of the same source code (that runs in full in iLogic), and I tested all of in on the provided document.&amp;nbsp; The result is that the lines move when they shouldn't.&amp;nbsp; They begin in one position before break link command, and end in a completely different position after break link command.&amp;nbsp; I posted an image of the bogus result (yellow lines do not outline the pipe, some have even moved down to the 0 elevation below the pipe.&amp;nbsp; I've been repeating it over and over, would you like a video as well?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:43:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368715#M90747</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-10-30T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368944#M90748</link>
      <description>&lt;P&gt;I have uploaded a screen cast, showing this issue with and without code.&lt;/P&gt;&lt;P&gt;&lt;A title="Screen Cast" href="https://autode.sk/2Sws1je" target="_blank"&gt;https://autode.sk/2Sws1je&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 15:54:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8368944#M90748</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-10-30T15:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8369708#M90758</link>
      <description>&lt;P&gt;I have an update worth posting.&amp;nbsp; I ran this code addition to defer sketch updates, and all the break lines looked great during breaking.&amp;nbsp; I stopped the code on the line sketch.DeferUpdates=false.&amp;nbsp; At the stop, the sketch looked perfect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="all line break link looking good" style="width: 725px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563662iC68FDD710100BE41/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="all line break link looking good" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;all line break link looking good&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, when the code ran the line deferupdates= false (turning off defer), the problematic sketch lines ALL jumped to their inappropriate places.&amp;nbsp; Also, hosting a transaction for each reference break has no positive effect at all.&lt;/P&gt;&lt;PRE&gt;    Public Sub BreakAllLinks(sketch As Sketch)
        sketch.DeferUpdates = True
        For Each en As SketchEntity In sketch.SketchEntities
            'Dim trans As Transaction = invApp.TransactionManager.StartTransaction(CType(sketch.Parent, ComponentDefinition).Document, "Break Link")
            en.Reference = False
            'trans.End()
        Next
        sketch.DeferUpdates = False
    End Sub&lt;/PRE&gt;&lt;P&gt;I'm guessing there is a calculation error taking place during the sketch update command.&amp;nbsp; My first thought was a point moving from one referenced location to another (by index) or received a 0 in its coordinate due to lack of access from another changing entity, so I thought 'break link while sketch updates are deferred'.&amp;nbsp; It was looking like the solution, until I reset the defer.&amp;nbsp; Then everything went splat, to the floor (or ceiling), miscalculations galore!&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error after defer update is turned off" style="width: 669px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563660iCBD431CBF5C755D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Error after defer update is turned off" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Error after defer update is turned off&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The user accessible undo command has "Disable Sketch Defer Updates".&amp;nbsp; If I undo that, it returns to the better picture.&amp;nbsp; If I edit sketch, defer updates, break all links, and end sketch edit (with defer updates left on) the entities remain in their proper place.&lt;/P&gt;&lt;PRE&gt;    Public Sub BreakAllLinks(sketch As Sketch)
        sketch.Edit()
        sketch.DeferUpdates = True
        For Each en As SketchEntity In sketch.SketchEntities
            'Dim trans As Transaction = invApp.TransactionManager.StartTransaction(CType(sketch.Parent, ComponentDefinition).Document, "Break Link")
            en.Reference = False
            'trans.End()
        Next
        sketch.ExitEdit()
        'sketch.DeferUpdates = False
    End Sub&lt;/PRE&gt;&lt;P&gt;But then Inventor becomes unstable, and the downstream code fails to get sketch.sketchlines items properly (system exception - can't find inventor, and fatal error (double boom!).&amp;nbsp; So leaving DeferUpdates set to False is a bad idea.&lt;/P&gt;&lt;P&gt;So can you simply add deferupdates = false AFTER you exit the sketch???&amp;nbsp; No.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="What a mess!" style="width: 921px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/563677i841E0874B8F36F34/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="What a mess!" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;What a mess!&lt;/span&gt;&lt;/span&gt;Problem NOT solved.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 20:51:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8369708#M90758</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2018-10-30T20:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8504067#M92903</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3677112"&gt;@JamieVJohnson2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A workaround is found. After rebuilding document&amp;nbsp;and breaking links, sketch entities links are broken properly. Can you please try below iLogic code?&lt;/P&gt;
&lt;PRE&gt;Sub Main()
	Dim oDoc As PartDocument 
	oDoc = ThisApplication.ActiveDocument 
	
	Dim oDef As PartComponentDefinition 
	oDef = oDoc.ComponentDefinition 
	
	Call oDoc.Rebuild()
	
	Dim oSketch As Sketch 
	oSketch = oDef.Sketches.Item("Sketch5")
	BreakAllLinks(oSketch)
End Sub 
Public Sub BreakAllLinks(sketch As Sketch)
	
		sketch.Edit()
        For Each en As SketchEntity In sketch.SketchEntities
            en.Reference = False
        Next
		sketch.ExitEdit()
End Sub&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 07:29:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8504067#M92903</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-01-07T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Break Link changes lines</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8504944#M92926</link>
      <description>&lt;P&gt;That works on my test widget.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 14:53:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/break-link-changes-lines/m-p/8504944#M92926</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2019-01-07T14:53:04Z</dc:date>
    </item>
  </channel>
</rss>

