<?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: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10570354#M128073</link>
    <description>&lt;P&gt;This sounds like it could potentially be a somewhat large project.&amp;nbsp; First of all, I would have to say that if you can do it manually, then there's hope that it can be done by iLogic.&amp;nbsp; Have you tried to do any of this manually yet?&amp;nbsp; In an assembly's BOM, you can manually add columns for standard &amp;amp; custom iProperties.&amp;nbsp; If those iProperties were reflections of parameters, that were being kept accurate, then you may have all the data you need in one place, as you are wanting.&amp;nbsp; Of course, since this is the BOM we're talking about, any columns you add to it for custom iProperties will effect/encompass all components listed in the BOM, so if that custom iProperty doesn't exist yet, it will create that custom iProperty within the document of every component listed.&amp;nbsp; It can be quicker/easier to mass create custom iProperties this way when needed.&amp;nbsp; The manual alternative would be to first open every component, and add the custom iProperty manually, then save them.&amp;nbsp; But it sounds like some of the information you are wanting shown within the BOM may need to be retrieved into these properties by iLogic rules which inspect those components and ensure the values of those properties are accurate.&amp;nbsp; Do you already have the rules needed to collect all the needed data from your model files into the parameters &amp;amp; properties?&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 18:14:37 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2021-08-24T18:14:37Z</dc:date>
    <item>
      <title>count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10568775#M128051</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;last time i was asking about iLogic rule to show laser cutting length in my drawing table. Today my question is:&lt;BR /&gt;Does Inventor 2021 have any possibility (ex by iLogic rule) to show parameters like&amp;nbsp;count of bends, laser cutting length, sheet thickness and bent part area in BOM table? It'd be easier to determine costs if I will have this parameters in 1 table together on assembly drawing.&lt;/P&gt;&lt;P&gt;Do anyone have skills and knowledge to write this rule?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10568775#M128051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T08:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10570354#M128073</link>
      <description>&lt;P&gt;This sounds like it could potentially be a somewhat large project.&amp;nbsp; First of all, I would have to say that if you can do it manually, then there's hope that it can be done by iLogic.&amp;nbsp; Have you tried to do any of this manually yet?&amp;nbsp; In an assembly's BOM, you can manually add columns for standard &amp;amp; custom iProperties.&amp;nbsp; If those iProperties were reflections of parameters, that were being kept accurate, then you may have all the data you need in one place, as you are wanting.&amp;nbsp; Of course, since this is the BOM we're talking about, any columns you add to it for custom iProperties will effect/encompass all components listed in the BOM, so if that custom iProperty doesn't exist yet, it will create that custom iProperty within the document of every component listed.&amp;nbsp; It can be quicker/easier to mass create custom iProperties this way when needed.&amp;nbsp; The manual alternative would be to first open every component, and add the custom iProperty manually, then save them.&amp;nbsp; But it sounds like some of the information you are wanting shown within the BOM may need to be retrieved into these properties by iLogic rules which inspect those components and ensure the values of those properties are accurate.&amp;nbsp; Do you already have the rules needed to collect all the needed data from your model files into the parameters &amp;amp; properties?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 18:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10570354#M128073</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-08-24T18:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10571730#M128086</link>
      <description>&lt;P&gt;hello, thanks for response.&lt;BR /&gt;&lt;BR /&gt;I managed to add sheet thickness, laser cut distance and bend radius to custom iproperties. But I still have a problem how to&amp;nbsp;invoke count of bends and see this in parameters. Can anyone edit my rule below? this rule working good but it only showing count of bends and isnt adding this to parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'access the active document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;' Set a reference to the active flat pattern.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;
&lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBends&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;FlatBendResults&lt;/SPAN&gt;
&lt;SPAN&gt;oBends&lt;/SPAN&gt; = &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;FlatBendResults&lt;/SPAN&gt;  

&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"FlatBendResults count: "&lt;/SPAN&gt; &amp;amp;  &lt;SPAN&gt;oBends&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAllBendEdges&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;EdgeCollection&lt;/SPAN&gt;
&lt;SPAN&gt;oTopFaceBendEdges&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateEdgeCollection&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oEdge&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Edge&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oEdges&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Edges&lt;/SPAN&gt;
 
&lt;SPAN&gt;' Get all Bend UP edges on top face  &lt;/SPAN&gt;
&lt;SPAN&gt;'True = Top Face&lt;/SPAN&gt;
&lt;SPAN&gt;oEdges&lt;/SPAN&gt; = &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;GetEdgesOfType&lt;/SPAN&gt; _
(&lt;SPAN&gt;FlatPatternEdgeTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kBendUpFlatPatternEdge&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)

&lt;SPAN&gt;i&lt;/SPAN&gt; = 0
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oEdge&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oEdges&lt;/SPAN&gt;
    &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;i&lt;/SPAN&gt; + 1
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;' Get all Bend DOWN edges on top face&lt;/SPAN&gt;
&lt;SPAN&gt;'True = Top Face&lt;/SPAN&gt;
&lt;SPAN&gt;oEdges&lt;/SPAN&gt; = &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;GetEdgesOfType&lt;/SPAN&gt; _
(&lt;SPAN&gt;FlatPatternEdgeTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kBendDownFlatPatternEdge&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oEdge&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oEdges&lt;/SPAN&gt;
    &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;i&lt;/SPAN&gt; + 1
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Top face bends count: "&lt;/SPAN&gt; &amp;amp;  &lt;SPAN&gt;i&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)

&lt;SPAN&gt;' Get all Bend UP edges on bottom face  &lt;/SPAN&gt;
&lt;SPAN&gt;'True = Bottom Face&lt;/SPAN&gt;
&lt;SPAN&gt;oEdges&lt;/SPAN&gt; = &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;GetEdgesOfType&lt;/SPAN&gt; _
(&lt;SPAN&gt;FlatPatternEdgeTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kBendUpFlatPatternEdge&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)

&lt;SPAN&gt;i&lt;/SPAN&gt; = 0
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oEdge&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oEdges&lt;/SPAN&gt;
    &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;i&lt;/SPAN&gt; + 1
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;' Get all Bend DOWN edges on bottom face&lt;/SPAN&gt;
&lt;SPAN&gt;'False = Bottom Face&lt;/SPAN&gt;
&lt;SPAN&gt;oEdges&lt;/SPAN&gt; = &lt;SPAN&gt;oFlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;GetEdgesOfType&lt;/SPAN&gt; _
(&lt;SPAN&gt;FlatPatternEdgeTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kBendDownFlatPatternEdge&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;oEdge&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oEdges&lt;/SPAN&gt;
    &lt;SPAN&gt;i&lt;/SPAN&gt; = &lt;SPAN&gt;i&lt;/SPAN&gt; + 1
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Bottom face bends count: "&lt;/SPAN&gt; &amp;amp;  &lt;SPAN&gt;i&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 07:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10571730#M128086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T07:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10572448#M128097</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;.&amp;nbsp; There are several different numbers to consider, so I'm not sure which ones you want to just show the user, and which ones you want written to parameters.&amp;nbsp; I created an alternate rule, based on your general idea, and included a few more things you might consider.&amp;nbsp; I have one big report (MsgBox) near the end to show results from all inspections.&amp;nbsp; Then I added a little code to the end, showing you how to write one of the values to a user parameter, if you wanted.&amp;nbsp; Then I commented that part out for now, until you have had time to decide which final numbers you want to write to parameters.&lt;/P&gt;
&lt;P&gt;Here's what I've got right now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then
	MsgBox("A Part Document must be active for this rule to work. Exiting.",vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
If Not TypeOf oPDoc.ComponentDefinition Is SheetMetalComponentDefinition Then
	MsgBox("This Part is not a Sheet Metal Part.  Exiting rule.",,"")
	Exit Sub
End If
Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
Dim oBends As Integer = oSMDef.Bends.Count
Dim oBendPartFeatures As Integer = oSMDef.Features.BendPartFeatures.Count
Dim oUnwrapFeatures As Integer = oSMDef.Features.UnwrapFeatures.Count
If Not oSMDef.HasFlatPattern Then
	Try
		oSMDef.Unfold
	Catch
		MsgBox("The attempt to 'Unfold' this part to get its Flat Pattern failed.  Exiting rule.", , "")
		Exit Sub
	End Try
End If
Dim oFPatt As FlatPattern = oSMDef.FlatPattern
Dim oFlatBendResults As Integer = oFPatt.FlatBendResults.Count

Dim oTopBendEdges, oBottomBendEdges, oTotalBendEdges As Integer
Dim oEdges As Edges
 
' Get all Bend UP edges on top face (True = Top Face)
oEdges = oFPatt.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendUpFlatPatternEdge, True)
oTopBendEdges = oEdges.Count

' Get all Bend DOWN edges on top face (True = Top Face)
oEdges = oFPatt.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendDownFlatPatternEdge, True)
oTopBendEdges = oTopBendEdges + oEdges.Count

' Get all Bend UP edges on bottom face (False = Bottom Face)
oEdges = oFPatt.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendUpFlatPatternEdge, False)
oBottomBendEdges = oEdges.Count

' Get all Bend DOWN edges on bottom face (False = Bottom Face)
oEdges = oFPatt.GetEdgesOfType(FlatPatternEdgeTypeEnum.kBendDownFlatPatternEdge, False)
oBottomBendEdges = oBottomBendEdges + oEdges.Count

oTotalBendEdges = oTopBendEdges + oBottomBendEdges

MsgBox("This Sheet Metal Part has:  " &amp;amp; vbCrLf &amp;amp; _
oBends &amp;amp; " 'Bends'" &amp;amp; vbCrLf &amp;amp; _
oBendPartFeatures &amp;amp; " 'BendPartFeatures'" &amp;amp; vbCrLf &amp;amp; _
oUnwrapFeatures &amp;amp; " 'UnwrapFeatures'" &amp;amp; vbCrLf &amp;amp; _
oFlatBendResults &amp;amp; " 'FlatBendResults'" &amp;amp; vbCrLf &amp;amp; _
oTopBendEdges &amp;amp; " Flat Pattern Top Face Bend Edges" &amp;amp; vbCrLf &amp;amp; _
oBottomBendEdges &amp;amp; " Flat Pattern Bottom Face Bend Edges" &amp;amp; vbCrLf &amp;amp; _
oTotalBendEdges &amp;amp; " Total Flat Pattern Bend Edges", , "")

'Dim oUParams As UserParameters = oSMDef.Parameters.UserParameters
'Dim oUParam As UserParameter
'Try
'	oUParam = oUParams.Item("BendsCount").Value = oBends
'Catch
'	oUParam = oUParams.AddByValue("BendsCount", oBends, UnitsTypeEnum.kUnitlessUnits)
'End Try&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank" rel="noopener"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank" rel="noopener"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 12:28:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10572448#M128097</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-08-25T12:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10578611#M128190</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;You're very helpful for me and thank you for this. But still I got problem because no one of parameters showed in MSGBOX didnt save in parameter list. I need total count of bends for part, I think it is just "Bends" in your rule. And totally I dont know how to repair this to have what i want..&lt;BR /&gt;&lt;BR /&gt;Could you edit your rule, last one time pls?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10578611#M128190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-27T13:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10578711#M128193</link>
      <description>&lt;P&gt;Here is an image I captured from my computer after I ran that rule on a simple sheet metal part with one bend.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Sheet Metal Bends Count Results.png" style="width: 962px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/958111i84B912A0AB18AC9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sheet Metal Bends Count Results.png" alt="Sheet Metal Bends Count Results.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;As you can see, the message displayed by my rule reported that there were:&lt;/P&gt;
&lt;P&gt;1 Bends&lt;/P&gt;
&lt;P&gt;0 BendPartFeatures&lt;/P&gt;
&lt;P&gt;0 UnwrapFeatures&lt;/P&gt;
&lt;P&gt;2 FlatBendResults&lt;/P&gt;
&lt;P&gt;1 Flat Pattern Top Face Bend Edges&lt;/P&gt;
&lt;P&gt;1 Flat Pattern Bottom Face Bend Edges&lt;/P&gt;
&lt;P&gt;2 Total Flat Pattern Bend Edges&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This part was started from a 'Face' feature (simple rectangular sketch, which was thickened into a solid plate using the sheet metal Plate tool.&amp;nbsp; Then I added one 'Flange' at 90 degrees using the sheet metal Flange tool, which automatically adds the bend in there for me, according to the current sheet metal rule.&amp;nbsp; The other features are just Hole features.&amp;nbsp; So this detailed inspection of this simple part, should give us some insight into how these types of things are counted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will now simplify my rule above to only get the 'Bends' count, then write that number to a user parameter named "BendsCount", similarly to what I had commented out at the end of that last code.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then
	MsgBox("A Part Document must be active for this rule to work. Exiting.",vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
If Not TypeOf oPDoc.ComponentDefinition Is SheetMetalComponentDefinition Then
	MsgBox("This Part is not a Sheet Metal Part.  Exiting rule.",,"")
	Exit Sub
End If
Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
Dim oBends As Integer = oSMDef.Bends.Count
MsgBox("This Sheet Metal Part has:  " &amp;amp; oBends &amp;amp; " 'Bends'.", vbInformation, "BendsCount")
Dim oUParams As UserParameters = oSMDef.Parameters.UserParameters
Dim oUParam As UserParameter
Try
	oUParam = oUParams.Item("BendsCount")
	oUParam.Value = oBends
Catch
	oUParam = oUParams.AddByValue("BendsCount", oBends, UnitsTypeEnum.kUnitlessUnits)
End Try&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:45:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10578711#M128193</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-08-27T13:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10583821#M128250</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Your rule work good as everytime. Im so thankful.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Have a nice day!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 06:58:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/10583821#M128250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-30T06:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: count of bends, laser cutting distance, sheet thickness and bent part area in BOM table</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/11532736#M144765</link>
      <description>Bravo!&lt;BR /&gt;Great tool to organize sheetmetal parts.&lt;BR /&gt;Thanks.</description>
      <pubDate>Sat, 05 Nov 2022 10:25:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/count-of-bends-laser-cutting-distance-sheet-thickness-and-bent/m-p/11532736#M144765</guid>
      <dc:creator>3deducad</dc:creator>
      <dc:date>2022-11-05T10:25:52Z</dc:date>
    </item>
  </channel>
</rss>

