<?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: Extract bendID or bendorder number from flatpattern in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5634029#M55881</link>
    <description>&lt;P&gt;Hello Vladimir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of a part / drawing and a description on what i want to do, extract and why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope you can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards. Kent boettger&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2015 00:26:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-14T00:26:15Z</dc:date>
    <item>
      <title>Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5626533#M55767</link>
      <description>&lt;P&gt;Hello Does anyone know how to extract the bend ID's and Bend order number from the 3D sheetmetal part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Counting bends does not return the same number at the Bend ID i a 2D bend table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the highest bendorder number from the sheetmetal part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;maybe counting bendlines does the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Kent boettger.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2015 10:38:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5626533#M55767</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T10:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5632819#M55851</link>
      <description>&lt;P&gt;Hi Kent,&lt;/P&gt;
&lt;P&gt;could you please upload your SheetMetal model&amp;nbsp;for test purposes?&lt;/P&gt;
&lt;P&gt;It would be great if you add some description as well (what you want to get from the model).&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 12:42:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5632819#M55851</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-05-13T12:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5634029#M55881</link>
      <description>&lt;P&gt;Hello Vladimir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of a part / drawing and a description on what i want to do, extract and why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope you can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards. Kent boettger&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2015 00:26:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5634029#M55881</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-14T00:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5641636#M55953</link>
      <description>&lt;P&gt;Any help here? Please.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 13:10:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5641636#M55953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-19T13:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5641835#M55956</link>
      <description>&lt;P&gt;&amp;nbsp;Here is my test for the flange feature #1 in your sheet metal model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/169211iC9A43FF9B9B73E00/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Flange.jpg" title="Flange.jpg" width="362" height="243" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Test()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As SheetMetalComponentDefinition
    Set oDef = oDoc.ComponentDefinition
    
    Dim oFlangeFeatures As FlangeFeatures
    Set oFlangeFeatures = oDef.Features.FlangeFeatures
    Debug.Print "FlangeFeatures.Count = " &amp;amp; oFlangeFeatures.Count
    
    ' Get the flange feature.
    Dim oFlange As FlangeFeature
    Set oFlange = oFlangeFeatures.Item(1)
    
    ' Position the end of part marker to just before this feature so the
    ' edges are in their original state.
    Call oFlange.SetEndOfPart(True)

    Dim oFlangeDef As FlangeDefinition
    Set oFlangeDef = oFlange.Definition

    Dim oEdge As Edge
    Set oEdge = oFlangeDef.Edges.Item(1)
    
    Dim Length As Double
    
        'calculation of the edge length
        Dim oCurveEval As CurveEvaluator
        Set oCurveEval = oEdge.Evaluator
        Dim MinParam As Double
        Dim MaxParam As Double
        Call oCurveEval.GetParamExtents(MinParam, MaxParam)
        Call oCurveEval.GetLengthAtParam(MinParam, MaxParam, Length)
        
    Debug.Print "Length, cm = " &amp;amp; Length
    
    ' Set the stop node back to the bottom of the browser.
    Call oDef.SetEndOfPartToTopOrBottom(False)
    
    Beep
End Sub&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;FlangeFeatures.Count = 3
Length, cm = 10&lt;/PRE&gt;
&lt;P&gt;Hope this could help.&lt;/P&gt;
&lt;P&gt;cheers,&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 14:55:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5641835#M55956</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2015-05-19T14:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5649685#M56072</link>
      <description>&lt;P&gt;Hello Vladimir.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is nice but actually not what i am locking for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;your code will not work when we have cosmetic bendlines in the model.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is my code so fare.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to be able to get the bend order number attached to each bendline in the model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this will give us the rigth bend count. see attached model, picture and code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bend count on the attached model will be 9, this is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the highest bend order number in the flatpattern is 7, this is right&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to read out the highest bend order number&amp;nbsp;"7".&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;P&gt;regards kent boettger&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        Dim m_invapp As Inventor.Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")

        ' Set a reference to the sheet metal document.
        ' This assumes a part document is active.

        Dim oPartDoc As PartDocument

        oPartDoc = m_invapp.ActiveDocument

        ' Make sure the document is a sheet metal document.

        If oPartDoc.SubType &amp;lt;&amp;gt; "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

            MsgBox("A sheet metal document must be open.")

            Exit Sub

        End If

        Dim oSheetMetalCompDef As SheetMetalComponentDefinition

        oSheetMetalCompDef = oPartDoc.ComponentDefinition

        If (Not oSheetMetalCompDef.HasFlatPattern) = True Then

            oSheetMetalCompDef.Unfold()

        End If

        Dim oFlatPattern As FlatPattern

        oFlatPattern = oSheetMetalCompDef.FlatPattern

        Dim oBendResults As FlatBendResults = oFlatPattern.FlatBendResults

        MsgBox("Bendlines = " &amp;amp; oBendResults.Count / 2)

        Dim oTotalBends As Integer = oBendResults.Count / 2

        Dim oBendresult As FlatBendResult

        For Each oBendresult In oBendResults

            ' Here i want to get the bend order number attached to the bendline?
            ' but i dont know how to do this.

            Dim oBendordernumber As Integer = oBendresult.GetBendOrder()

        Next&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 May 2015 06:08:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5649685#M56072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-23T06:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5659238#M56280</link>
      <description>&lt;P&gt;Hi Kent,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So is this all that's missing for you?&lt;/P&gt;
&lt;PRE&gt;        Dim oBendorderNumber As Long
        Dim oBendorderSource As BendOrderSourceTypeEnum
        Call oBendresult.GetBendOrder(oBendorderNumber, oBendorderSource)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 10:57:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5659238#M56280</guid>
      <dc:creator>adam.nagy</dc:creator>
      <dc:date>2015-06-01T10:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract bendID or bendorder number from flatpattern</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5659476#M56289</link>
      <description>&lt;P&gt;Thanks Adam, Just what i was looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; Dim oFlatPattern As FlatPattern

        oFlatPattern = oSheetMetalCompDef.FlatPattern

        Dim oBendResults As FlatBendResults = oFlatPattern.FlatBendResults

        'Dim oTotalBends As Integer = oBendResults.Count / 2 ( This was wrong )

        Dim oBendresult As FlatBendResult

        Dim oBendCountReal As Long = Nothing

        For Each oBendresult In oBendResults

            Dim oBendordernumber As Long
            Dim oBendorderSource As BendOrderSourceTypeEnum

            Call oBendresult.GetBendOrder(oBendordernumber, oBendorderSource)

            If oBendordernumber &amp;gt; oBendCountReal Then

                oBendCountReal = oBendordernumber

            End If

        Next

        'MsgBox("oBendCountReal = " &amp;amp; oBendCountReal)

        Return oBendCountReal&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2015 13:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/extract-bendid-or-bendorder-number-from-flatpattern/m-p/5659476#M56289</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-01T13:43:01Z</dc:date>
    </item>
  </channel>
</rss>

