<?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: sheet metal flat pattern total loop length in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9463054#M64155</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Hope this will work.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub LoopLength()
    
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oCmpDef As SheetMetalComponentDefinition
    Set oCmpDef = oDoc.ComponentDefinition
    
    Dim oFp As FlatPattern
    Set oFp = oCmpDef.FlatPattern
    
    Dim oBf As Face
    Set oBf = oFp.BaseFace
    
    Dim i As Integer
    Dim Result As Single
    Result = 0
    For i = 1 To oBf.EdgeLoops.Count
    
    Dim oEl As EdgeLoop
    Set oEl = oBf.EdgeLoops.Item(i)
    
    Result = (ThisApplication.MeasureTools.GetLoopLength(oEl) * 10) + Result
    Next
    MsgBox (Result)
    
    Dim textValue As Single
    textValue = Result
    Dim oName As String
    oName = "LoopLength"
    
    Dim oCProp As PropertySet
    Set oCProp = oDoc.PropertySets.Item("Inventor User Defined Properties")
    
    Dim oProp As Property
    Set oProp = oCProp.Add(textValue, oName)
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Karth&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2020 18:38:54 GMT</pubDate>
    <dc:creator>k14348</dc:creator>
    <dc:date>2020-04-22T18:38:54Z</dc:date>
    <item>
      <title>sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462609#M64151</link>
      <description>&lt;P&gt;Is there anyway to return this value using Ilogic or other non manual method? I can do it manually with the measure tool but ideally would like it to appear in the BOM.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 15:44:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462609#M64151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-22T15:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462837#M64152</link>
      <description>&lt;P&gt;To clarify...you are wanting the total perimeter length of the outside edges of the flat pattern, right? (not including any interior holes or cutouts?)&lt;/P&gt;&lt;P&gt;The Flat Pattern Width, Flat Pattern Length, and Flat Pattern Area (items 44,45, &amp;amp; 46) are all available in the iProperties, under the "Design Tracking Properties" set. But I don't think there is a pre-existing iProperty for the Perimeter.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 17:16:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462837#M64152</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-04-22T17:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462893#M64153</link>
      <description>Hi. No, all internal profiles also.&lt;BR /&gt;&lt;BR /&gt;When you flat pattern a part and select measure, when you then click the&lt;BR /&gt;face it gives a Total Loop Length. It's this I want to read.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Apr 2020 17:33:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9462893#M64153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-22T17:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9463001#M64154</link>
      <description>&lt;P&gt;Here's some iLogic code you can use.&amp;nbsp; In the MsgBox, I'm dividing by 2.54 to convert centimeters to inches.&lt;/P&gt;&lt;P&gt;To just get the Perimeter, you can change the loop, to simply checking if the oEdgeLoop.IsOuterEdgeLoop, then use that one in your MsgBox.&amp;nbsp; You could also put checks at the top to check DocumentTypeEnum and SubType, if you wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oSMDoc As PartDocument = ThisApplication.ActiveDocument
Dim oSMDef As SheetMetalComponentDefinition = oSMDoc.ComponentDefinition
If oSMDef.HasFlatPattern = False Then
	MsgBox("There is no Flat Pattern yet.", vbOKOnly, "NO FLAT PATTERN")
	Return
End If
Dim oTopFace As Face = oSMDef.FlatPattern.TopFace
Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools
Dim oLoopLength As Double = 0
For Each oEdgeLoop As EdgeLoop In oTopFace.EdgeLoops
	oLoopLength = oLoopLength + oMeasureTools.GetLoopLength(oEdgeLoop)
Next
MsgBox("Loop Length = " &amp;amp; oLoopLength/2.54)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;If this solves your problem, or answers your questions, please click 'Accept As Solution".&lt;BR /&gt;Or, if this helps you reach your goal, please click 'LIKES" &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.&lt;BR /&gt;If you agree with any of them, please vote for them.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add more capabilities to the 'Customize' dialog box (exe. Add Tab &amp;amp; Add Panel) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/add-more-capabilities-to-the-customize-dialog-box-exe-add-tab/idi-p/9371747/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;MessageBox, InputBox, and InputListBox Size &amp;amp; Format Options &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/text-format-amp-size-options-messagebox-inputbox-inputlistbox/idi-p/9169817/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Constrain &amp;amp; Dimension Images In Assembly Sketches &amp;amp; Drawing Sketches (TitleBlocks &amp;amp; SketchedSymbols) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/we-need-the-ability-to-fully-constrain-amp-dimension-images/idi-p/9299088/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/save-section-view-status-in-designviewrepresentation-so-is/idi-p/9270962/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Add SolidBodies Folder In iLogic Rule Editor Model Tab &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/ilogic-rule-editor-gt-model-tab-add-a-solid-bodies-folder-for/idi-p/9270898/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawings-in-oldversions-set-all-views-to-raster-before-autosave/idi-p/9185521/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;SetDesignViewRepresentation - Fix limitations for DrawingView of a Part &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/setdesignviewrepresentation-fix-limitations-for-drawingview-of-a/idi-p/9369920/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Create DocumentSubTypeEnum &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/create-enum-for-documentsubtype-amp-or-document-subtype/idi-p/9402300/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 18:16:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9463001#M64154</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-04-22T18:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9463054#M64155</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Hope this will work.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub LoopLength()
    
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oCmpDef As SheetMetalComponentDefinition
    Set oCmpDef = oDoc.ComponentDefinition
    
    Dim oFp As FlatPattern
    Set oFp = oCmpDef.FlatPattern
    
    Dim oBf As Face
    Set oBf = oFp.BaseFace
    
    Dim i As Integer
    Dim Result As Single
    Result = 0
    For i = 1 To oBf.EdgeLoops.Count
    
    Dim oEl As EdgeLoop
    Set oEl = oBf.EdgeLoops.Item(i)
    
    Result = (ThisApplication.MeasureTools.GetLoopLength(oEl) * 10) + Result
    Next
    MsgBox (Result)
    
    Dim textValue As Single
    textValue = Result
    Dim oName As String
    oName = "LoopLength"
    
    Dim oCProp As PropertySet
    Set oCProp = oDoc.PropertySets.Item("Inventor User Defined Properties")
    
    Dim oProp As Property
    Set oProp = oCProp.Add(textValue, oName)
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Karth&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 18:38:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9463054#M64155</guid>
      <dc:creator>k14348</dc:creator>
      <dc:date>2020-04-22T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9466908#M64156</link>
      <description>&lt;P&gt;Hi, the below works really well adapting it to write to Custom Iproperties. Is there a way to drive this from assembly level so I don't have to manually add a rule to each part?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oSMDoc As PartDocument = ThisApplication.ActiveDocument&lt;BR /&gt;Dim oSMDef As SheetMetalComponentDefinition = oSMDoc.ComponentDefinition&lt;BR /&gt;If oSMDef.HasFlatPattern = False Then&lt;BR /&gt;MsgBox("There is no Flat Pattern yet.", vbOKOnly, "NO FLAT PATTERN")&lt;BR /&gt;Return&lt;BR /&gt;End If&lt;BR /&gt;Dim oTopFace As Face = oSMDef.FlatPattern.TopFace&lt;BR /&gt;Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools&lt;BR /&gt;Dim oLoopLength As Double = 0&lt;BR /&gt;For Each oEdgeLoop As EdgeLoop In oTopFace.EdgeLoops&lt;BR /&gt;oLoopLength = oLoopLength + oMeasureTools.GetLoopLength(oEdgeLoop)&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;iProperties.Value("Custom", "TOTAL_LOOP_LENGTH") = Round(oLoopLength*10)&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 08:35:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9466908#M64156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-24T08:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9466982#M64157</link>
      <description>&lt;P&gt;&lt;BR /&gt;Sub Assyupdate()&lt;/P&gt;&lt;P&gt;Dim openDoc As AssemblyDocument&lt;BR /&gt;Set openDoc = ThisApplication.ActiveDocument&lt;BR /&gt;Dim doc As PartDocument&lt;BR /&gt;For Each doc In openDoc.AllReferencedDocuments&lt;BR /&gt;If doc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then&lt;BR /&gt;&lt;BR /&gt;Dim oCmpDef As SheetMetalComponentDefinition&lt;BR /&gt;Set oCmpDef = doc.ComponentDefinition&lt;BR /&gt;&lt;BR /&gt;Dim oFp As FlatPattern&lt;BR /&gt;Set oFp = oCmpDef.FlatPattern&lt;BR /&gt;&lt;BR /&gt;Dim oBf As Face&lt;BR /&gt;Set oBf = oFp.BaseFace&lt;BR /&gt;&lt;BR /&gt;Dim i As Integer&lt;BR /&gt;Dim Result As Single&lt;BR /&gt;Result = 0&lt;BR /&gt;For i = 1 To oBf.EdgeLoops.Count&lt;BR /&gt;&lt;BR /&gt;Dim oEl As EdgeLoop&lt;BR /&gt;Set oEl = oBf.EdgeLoops.Item(i)&lt;BR /&gt;&lt;BR /&gt;Result = (ThisApplication.MeasureTools.GetLoopLength(oEl) * 10) + Result&lt;BR /&gt;Next&lt;BR /&gt;&lt;BR /&gt;Dim textValue As Single&lt;BR /&gt;textValue = Result&lt;BR /&gt;Dim oName As String&lt;BR /&gt;oName = "LoopLength"&lt;BR /&gt;&lt;BR /&gt;Dim oCProp As PropertySet&lt;BR /&gt;Set oCProp = doc.PropertySets.Item("Inventor User Defined Properties")&lt;BR /&gt;&lt;BR /&gt;Dim oProp As Property&lt;BR /&gt;Set oProp = oCProp.Add(textValue, oName)&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 09:05:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9466982#M64157</guid>
      <dc:creator>k14348</dc:creator>
      <dc:date>2020-04-24T09:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9467001#M64158</link>
      <description>&lt;P&gt;Hi, thanks but I'm getting the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule program format:&lt;/P&gt;&lt;P&gt;All other sub's or functions must be after Sub Main()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 09:13:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9467001#M64158</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-24T09:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9467261#M64159</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oSMDoc As PartDocument
Dim oSMDef As SheetMetalComponentDefinition
Dim oTopFace As Face
Dim oMeasureTools As MeasureTools = ThisApplication.MeasureTools
Dim oLoopLength As Double
Dim oEdgeLoop As EdgeLoop
Dim oCustPropSet As PropertySet
Dim oProp As [Property]
Dim oPropName As String = "TOTAL_LOOP_LENGTH"
Dim oPropValue As Double
Dim oExists As Boolean  = False

For Each oRefDoc As Document In oADoc.AllReferencedDocuments
	If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		If oRefDoc.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Autodesk Inventor Sheet Metal Part" Then
			oSMDoc = oRefDoc
			oSMDef = oSMDoc.ComponentDefinition
			If oSMDef.HasFlatPattern = False Then
				MsgBox("There is no Flat Pattern yet.", vbOKOnly, "NO FLAT PATTERN")
				Return
			End If
			oTopFace = oSMDef.FlatPattern.TopFace
			oLoopLength = 0
			For Each oEdgeLoop In oTopFace.EdgeLoops
				oLoopLength = oLoopLength + oMeasureTools.GetLoopLength(oEdgeLoop)
			Next
			oPropValue = Round(oLoopLength * 10)
			oCustPropSet = oSMDoc.PropertySets.Item("Inventor User Defined Properties")
			For Each oProp In oCustPropSet
				If oProp.Name = oPropName Then
					oExists = True
					oProp.Value = oPropValue
				End If
			Next
			If oExists = False Then
				oCustPropSet.Add(oPropValue, oPropName)
			End If
		End If
	End If
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;BR /&gt;If this solves your problem, or answers your questions, please click 'Accept As Solution".&lt;BR /&gt;Or, if this helps you reach your goal, please click 'LIKES" &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.&lt;BR /&gt;If you agree with any of them, please vote for them.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add more capabilities to the 'Customize' dialog box (exe. Add Tab &amp;amp; Add Panel) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/add-more-capabilities-to-the-customize-dialog-box-exe-add-tab/idi-p/9371747/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;MessageBox, InputBox, and InputListBox Size &amp;amp; Format Options &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/text-format-amp-size-options-messagebox-inputbox-inputlistbox/idi-p/9169817/" target="_blank" rel="noopener"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Constrain &amp;amp; Dimension Images In Assembly Sketches &amp;amp; Drawing Sketches (TitleBlocks &amp;amp; SketchedSymbols) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/we-need-the-ability-to-fully-constrain-amp-dimension-images/idi-p/9299088/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/save-section-view-status-in-designviewrepresentation-so-is/idi-p/9270962/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Add SolidBodies Folder In iLogic Rule Editor Model Tab &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/ilogic-rule-editor-gt-model-tab-add-a-solid-bodies-folder-for/idi-p/9270898/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/drawings-in-oldversions-set-all-views-to-raster-before-autosave/idi-p/9185521/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;SetDesignViewRepresentation - Fix limitations for DrawingView of a Part &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/setdesignviewrepresentation-fix-limitations-for-drawingview-of-a/idi-p/9369920/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Create DocumentSubTypeEnum &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/create-enum-for-documentsubtype-amp-or-document-subtype/idi-p/9402300/" target=" Blank"&gt;Click Here &lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/" target="_blank"&gt;Inventor 2020 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 11:02:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9467261#M64159</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-04-24T11:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475927#M64160</link>
      <description>&lt;P&gt;Sorry no can't get this to work. Rule runs with no errors but nothing is written to any sheet metal parts.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 10:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475927#M64160</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-28T10:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475944#M64161</link>
      <description>&lt;P&gt;A message box placed below this line doesn't appear when the rule is run but does when placed above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If oRefDoc.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Autodesk Inventor Sheet Metal Part" Then&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 10:12:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475944#M64161</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-28T10:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475997#M64162</link>
      <description>&lt;P&gt;@Anonymous&lt;/P&gt;&lt;P&gt;try changing it to:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Document SubType Name"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Sheet Metal"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentSubType&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentSubTypeID&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;That should work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 10:35:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9475997#M64162</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-04-28T10:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476112#M64163</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first suggestion works thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, if there is a sheet metal part without a flat pattern&amp;nbsp; then the process fails and ideally id like it to then flat pattern the relevant part and continue instead of returning a message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If oSMDef.HasFlatPattern = False Then&lt;BR /&gt;MsgBox("There is no Flat Pattern yet.", vbOKOnly, "NO FLAT PATTERN")&lt;BR /&gt;Return&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below but not sure how to incorporate it into your rule?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If oCompDef.HasFlatPattern = False Then&lt;BR /&gt;oCompDef.Unfold&lt;BR /&gt;oDoc.Save&lt;BR /&gt;oDoc.Close&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 11:29:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476112#M64163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-28T11:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476145#M64164</link>
      <description>&lt;P&gt;Hi @Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also turned off screen updating in the application while unfolding the part so you dont have to see it open the part and unfold it. Also reactivated the assembly document after.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oADoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Face&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMeasureTools&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;EdgeLoop&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PropertySet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[Property]&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"TOTAL_LOOP_LENGTH"&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oADoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Document SubType Name"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Sheet Metal"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasFlatPattern&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Unfold&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
				&lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Activate&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TopFace&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; = 0
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;EdgeLoops&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; + &lt;SPAN style="color: #800000;"&gt;oMeasureTools&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetLoopLength&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Round&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; * 10)
			&lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #800080;"&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2020 11:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476145#M64164</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-04-28T11:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476213#M64165</link>
      <description>&lt;P&gt;This is better. Doesnt leave the document that we had to unfold open...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oADoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Face&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMeasureTools&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;MeasureTools&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;EdgeLoop&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PropertySet&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[Property]&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"TOTAL_LOOP_LENGTH"&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oADoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Document SubType Name"&lt;/SPAN&gt;).&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #008080;"&gt;"Sheet Metal"&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oRefDoc&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;HasFlatPattern&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Unfold&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;cDef&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"PartSwitchRepresentationCmd"&lt;/SPAN&gt;)
					&lt;SPAN style="color: #800000;"&gt;cDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Execute&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Catch&lt;/SPAN&gt;
					&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Try&lt;/SPAN&gt;
				&lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Activate&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Close&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TopFace&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; = 0
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oTopFace&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;EdgeLoops&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; + &lt;SPAN style="color: #800000;"&gt;oMeasureTools&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetLoopLength&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oEdgeLoop&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;Round&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oLoopLength&lt;/SPAN&gt; * 10)
			&lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Name&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oProp&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oExists&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Then&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;oCustPropSet&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oPropValue&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oPropName&lt;/SPAN&gt;)
			&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #800080;"&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN style="color: #ff0000;"&gt;True&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2020 12:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/9476213#M64165</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-04-28T12:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10330645#M64166</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Sorry. I meant to reply to Jhoel Forshav.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 22:43:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10330645#M64166</guid>
      <dc:creator>Donna_Fleming</dc:creator>
      <dc:date>2021-05-21T22:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10330656#M64167</link>
      <description>&lt;P&gt;I know it's been&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;a year, but thank you for providing this code.&amp;nbsp; It gets me a long way to where we need to be. We are asked to provide the total cutting inches required for the assembly. Would you be willing to add to this code so it totals the loop lengths for each piece to create a custom property in the assembly?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 22:42:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10330656#M64167</guid>
      <dc:creator>Donna_Fleming</dc:creator>
      <dc:date>2021-05-21T22:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: sheet metal flat pattern total loop length</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10338653#M64168</link>
      <description>&lt;P&gt;I found some code by Curtis W. in another forum that worked for me to get a total of all the values created by the code &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp; wrote. This is my complete rule combining the code of these two fine gentlemen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oADoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSMDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSMDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oTopFace&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Face&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oMeasureTools&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;MeasureTools&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;MeasureTools&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oLoopLength&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;EdgeLoop&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCustPropSet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PropertySet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oProp&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;[Property]&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPropName&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"LOOP_LENGTH"&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPropValue&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oExists&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Boolean&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oADoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Design Tracking Properties"&lt;/SPAN&gt;).&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Document SubType Name"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;"Sheet Metal"&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;oSMDoc&lt;/SPAN&gt; = &lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;
			&lt;SPAN&gt;oSMDef&lt;/SPAN&gt; = &lt;SPAN&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;HasFlatPattern&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
				&lt;SPAN&gt;Try&lt;/SPAN&gt;
					&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
					&lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;Unfold&lt;/SPAN&gt;
					&lt;SPAN&gt;cDef&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;ControlDefinitions&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"PartSwitchRepresentationCmd"&lt;/SPAN&gt;)
					&lt;SPAN&gt;cDef&lt;/SPAN&gt;.&lt;SPAN&gt;Execute&lt;/SPAN&gt;
					&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
				&lt;SPAN&gt;Catch&lt;/SPAN&gt;
					&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ScreenUpdating&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
				&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
				&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;Activate&lt;/SPAN&gt;
				&lt;SPAN&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;
			&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
			&lt;SPAN&gt;oTopFace&lt;/SPAN&gt; = &lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;TopFace&lt;/SPAN&gt;
			&lt;SPAN&gt;oLoopLength&lt;/SPAN&gt; = 0
			&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oEdgeLoop&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oTopFace&lt;/SPAN&gt;.&lt;SPAN&gt;EdgeLoops&lt;/SPAN&gt;
				&lt;SPAN&gt;oLoopLength&lt;/SPAN&gt; = &lt;SPAN&gt;oLoopLength&lt;/SPAN&gt; + &lt;SPAN&gt;oMeasureTools&lt;/SPAN&gt;.&lt;SPAN&gt;GetLoopLength&lt;/SPAN&gt;(&lt;SPAN&gt;oEdgeLoop&lt;/SPAN&gt;)
			&lt;SPAN&gt;Next&lt;/SPAN&gt;
			&lt;SPAN&gt;oPropValue&lt;/SPAN&gt; = &lt;SPAN&gt;oLoopLength&lt;/SPAN&gt;/2.54
			&lt;SPAN&gt;oCustPropSet&lt;/SPAN&gt; = &lt;SPAN&gt;oSMDoc&lt;/SPAN&gt;.&lt;SPAN&gt;PropertySets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Inventor User Defined Properties"&lt;/SPAN&gt;)
			&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oProp&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oCustPropSet&lt;/SPAN&gt;
				&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oProp&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;oPropName&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
					&lt;SPAN&gt;oExists&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
					&lt;SPAN&gt;oProp&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN&gt;oPropValue&lt;/SPAN&gt;
				&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
			&lt;SPAN&gt;Next&lt;/SPAN&gt;
			&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oExists&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
				&lt;SPAN&gt;oCustPropSet&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oPropValue&lt;/SPAN&gt;, &lt;SPAN&gt;oPropName&lt;/SPAN&gt;)
			&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;UpdateWhenDone&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt;
&lt;SPAN&gt;'clear the custom property in the assembly &lt;/SPAN&gt;
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"TOTAL_LOOP_LENGTH"&lt;/SPAN&gt;) = 0
&lt;SPAN&gt;'set a reference to the assembly component definintion.&lt;/SPAN&gt;
&lt;SPAN&gt;'This assumes an assembly document is open.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;'Iterate through all of the occurrences&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;
&lt;SPAN&gt;'check for and skip virtual components&lt;/SPAN&gt;
&lt;SPAN&gt;'(in case a virtual component trips things up)&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;VirtualComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;'custom property in the assembly &lt;/SPAN&gt;
&lt;SPAN&gt;xNumber&lt;/SPAN&gt; = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"TOTAL_LOOP_LENGTH"&lt;/SPAN&gt;) 
&lt;SPAN&gt;'custom property in the parts&lt;/SPAN&gt;
&lt;SPAN&gt;yNumber&lt;/SPAN&gt; = &lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;oOccurrence&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;, &lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"LOOP_LENGTH"&lt;/SPAN&gt;)
&lt;SPAN&gt;sumNumber&lt;/SPAN&gt; = &lt;SPAN&gt;xNumber&lt;/SPAN&gt; + &lt;SPAN&gt;yNumber&lt;/SPAN&gt;
&lt;SPAN&gt;'set custom property values&lt;/SPAN&gt;
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"TOTAL_LOOP_LENGTH"&lt;/SPAN&gt;) = &lt;SPAN&gt;sumNumber&lt;/SPAN&gt; 
&lt;SPAN&gt;Else&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;It works for me. If you have problems with it, I am sorry but my skills are not good enough&lt;BR /&gt;to solve your issue. I'm pretty much just a borrower of code at this stage and rely heavily&lt;BR /&gt; on gracious people who share their skills.&lt;/PRE&gt;&lt;P&gt;in&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 17:13:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-total-loop-length/m-p/10338653#M64168</guid>
      <dc:creator>Donna_Fleming</dc:creator>
      <dc:date>2021-05-25T17:13:33Z</dc:date>
    </item>
  </channel>
</rss>

