<?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: Inventor Ilogic : Select bends with the pick function in PartDocument. in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416259#M142589</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;.&amp;nbsp;Thanks a lot. This will really help me move forward.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 15:46:57 GMT</pubDate>
    <dc:creator>vpeuvion</dc:creator>
    <dc:date>2022-09-12T15:46:57Z</dc:date>
    <item>
      <title>Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11415810#M142578</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;Is there a way to select a bend of a part like when using the unbend function with the pick function in PartDocument.&lt;BR /&gt;I can't find it in the Selection Filter Enumerator list.&lt;BR /&gt;I would like to be able to select bends with the pick function.&lt;BR /&gt;Does somebody have an idea?&lt;BR /&gt;Thanks. Vincent.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vpeuvion_0-1662988038551.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1114629iC78363E6CE5ECF27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vpeuvion_0-1662988038551.png" alt="vpeuvion_0-1662988038551.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 13:09:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11415810#M142578</guid>
      <dc:creator>vpeuvion</dc:creator>
      <dc:date>2022-09-12T13:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11415909#M142582</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8016681"&gt;@vpeuvion&lt;/a&gt;.&amp;nbsp; It is true that the &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=SelectionFilterEnum" target="_blank" rel="noopener"&gt;SelectionFilterEnum&lt;/A&gt; does not contain a variation specifically for a &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=Bend" target="_blank" rel="noopener"&gt;Bend&lt;/A&gt; object or a &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=BendFeature" target="_blank" rel="noopener"&gt;BendFeature&lt;/A&gt; object.&amp;nbsp; The closest variation is the kPartFeatureFilter option.&amp;nbsp; What do you intend to do with the bend, once selected?&amp;nbsp; You may just have to use a secondary filter to avoid getting the wrong Type, or just loop through all bends, instead of using Pick function.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 13:47:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11415909#M142582</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-09-12T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416019#M142585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;.&amp;nbsp;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Here's a simplified example of what I'm trying to do.&lt;/P&gt;&lt;P&gt;In this example, I select the reference face, the part is fully unfolded and then the part is refolded.&lt;/P&gt;&lt;P&gt;I wish I could select just one bend for refolding. The oBends objectCollection would only contain the selected bend.&lt;/P&gt;&lt;P&gt;Do I have to select a face that belongs to the bend and from there find the FlatBendResult?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;main&lt;/SPAN&gt;()
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&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;oSMCD&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSMF&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalFeatures&lt;/SPAN&gt; = &lt;SPAN&gt;oSMCD&lt;/SPAN&gt;.&lt;SPAN&gt;Features&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;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;ObjectCollection&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateObjectCollection&lt;/SPAN&gt;
	
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFace&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Face&lt;/SPAN&gt;
	&lt;SPAN&gt;oFace&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAllPlanarEntities&lt;/SPAN&gt;,&lt;SPAN&gt;"Sélectionner la face de référence"&lt;/SPAN&gt;)
	&lt;SPAN&gt;oSMF&lt;/SPAN&gt;.&lt;SPAN&gt;UnfoldFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;)

	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"refold"&lt;/SPAN&gt;)
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;i&lt;/SPAN&gt; = 1 &lt;SPAN&gt;To&lt;/SPAN&gt; &lt;SPAN&gt;oSMCD&lt;/SPAN&gt;.&lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;FlatBendResults&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt;
		&lt;SPAN&gt;oBends&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oSMCD&lt;/SPAN&gt;.&lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;FlatBendResults&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;i&lt;/SPAN&gt;).&lt;SPAN&gt;Bend&lt;/SPAN&gt;)
	&lt;SPAN&gt;Next&lt;/SPAN&gt;
	&lt;SPAN&gt;oSMF&lt;/SPAN&gt;.&lt;SPAN&gt;RefoldFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;,&lt;SPAN&gt;oBends&lt;/SPAN&gt;)
	
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 14:26:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416019#M142585</guid>
      <dc:creator>vpeuvion</dc:creator>
      <dc:date>2022-09-12T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416238#M142587</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8016681"&gt;@vpeuvion&lt;/a&gt;.&amp;nbsp; I think I have worked out a way that you can use.&amp;nbsp; Check out the example below, and see if that works for you.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
	Dim oSMCD As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition
	Dim oBendsEnum As BendsEnumerator = oSMCD.Bends
	Dim oSMF As SheetMetalFeatures = oSMCD.Features
	Dim oCM As CommandManager = ThisApplication.CommandManager
	
	'get stationary face
	Dim oFace As Face = oCM.Pick(SelectionFilterEnum.kPartFaceFilter,"Sélectionner la face de référence")
	If IsNothing(oFace) Then Return
		
	'get the bend to unfold
	Dim oBendFace As Face = oCM.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Face Of Bend")
	If IsNothing(oBendFace) Then Return
	Dim oBend As Bend
	Try
		'you can get a specific Bend by specifying either Index # or Face object belonging to a Bend
		oBend = oBendsEnum.Item(oBendFace)
	Catch
		MsgBox("Selected Face did not belong to a Bend.", vbExcamation, "")
		Return
	End Try

	'add the Bend to our oBends collection
	Dim oBends As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
	oBends.Add(oBend)
	
	'create the UnfoldFeatrue for just that one Bend
	Dim oUnFoldFeat As UnfoldFeature
	If oBend.IsFlat = False Then
		'MsgBox("Bend is not flat, so we are able to unfold it.",,"")
		oUnFoldFeat = oSMF.UnfoldFeatures.Add(oFace, oBends)
	Else
		'MsgBox("Bend is already flat, so we are NOT able to unfold it.",,"")
	End If
	oPartDoc.Update
	
	MsgBox("Now to refold the bend.",,"")
	're-set contents of oBends using UnfoldFeature we created above
	oBends.Clear
	For Each oB In oUnFoldFeat.Bends
		oBends.Add(oB)
	Next
	oSMF.RefoldFeatures.Add(oFace, oBends)
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&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;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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 15:36:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416238#M142587</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-09-12T15:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416259#M142589</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;.&amp;nbsp;Thanks a lot. This will really help me move forward.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 15:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11416259#M142589</guid>
      <dc:creator>vpeuvion</dc:creator>
      <dc:date>2022-09-12T15:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Ilogic : Select bends with the pick function in PartDocument.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11417499#M142614</link>
      <description>&lt;P&gt;You could also change this rule:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	'get the bend to unfold
	Dim oBendFace As Face = oCM.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Face Of Bend")
	If IsNothing(oBendFace) Then Return&lt;/LI-CODE&gt;&lt;P&gt;into:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	'get the bend to unfold
	Dim oBendFace As Face = oCM.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Select Face Of Bend")
	If IsNothing(oBendFace) Then Return&lt;/LI-CODE&gt;&lt;P&gt;This way you get to select only bends.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 06:15:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/inventor-ilogic-select-bends-with-the-pick-function-in/m-p/11417499#M142614</guid>
      <dc:creator>TechInventor20</dc:creator>
      <dc:date>2022-09-13T06:15:03Z</dc:date>
    </item>
  </channel>
</rss>

