<?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: iLogic Part contains Solidbody in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13676264#M175445</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;works like a gem as intended!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is folding the part with which has the A-face as intended. Can we code it to prompt us to create A-side instead of selecting BaseFace for the part which does not have A-side and then flat pattern it with the A-side created?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jun 2025 12:51:45 GMT</pubDate>
    <dc:creator>ToniCoelhoE8VJF</dc:creator>
    <dc:date>2025-06-11T12:51:45Z</dc:date>
    <item>
      <title>iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9150721#M69515</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I've been thinking about how to do that for a long time.&lt;BR /&gt;I have a code that unfolds all the Sheet Metal. It works.&lt;BR /&gt;The problem is when I use it on Components that contain Solidbody. Pop up error, unfold, contain only some ipt&lt;/P&gt;&lt;P&gt;Video and File in attachment.&lt;/P&gt;&lt;P&gt;I want to write this down, but I don't know how.&lt;/P&gt;&lt;P&gt;If Part contain more than 1 Solidbody Then Continue For&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
&lt;SPAN&gt;'Loop through all referenced docs in assembly&lt;/SPAN&gt;
	
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&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;In&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
		&lt;SPAN&gt;'Check if unfold exists. If not try to unfold&lt;/SPAN&gt;
		
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Type&lt;/SPAN&gt; = 150995200 &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDefSM&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN&gt;oCompDefSM&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
			    
			&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oCompDefSM&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;oCompDefSM&lt;/SPAN&gt;.&lt;SPAN&gt;Unfold&lt;/SPAN&gt;
				&lt;SPAN&gt;oCompDefSM&lt;/SPAN&gt;.&lt;SPAN&gt;FlatPattern&lt;/SPAN&gt;.&lt;SPAN&gt;ExitEdit&lt;/SPAN&gt;
			    &lt;SPAN&gt;oCompDefSM&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt; (&lt;SPAN&gt;True&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;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 16:46:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9150721#M69515</guid>
      <dc:creator>dusan.naus.trz</dc:creator>
      <dc:date>2019-11-16T16:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9151668#M69516</link>
      <description>&lt;P&gt;you can try this rule.&lt;/P&gt;&lt;PRE&gt;Dim doc As Document = ThisApplication.ActiveDocument
'Loop through all referenced docs in assembly

For Each oDoc As Document In doc.AllReferencedDocuments
    ' Check if its a part document 
    If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
        Dim pDoc As PartDocument = oDoc
        ' Check if there are multiple solid bodies
        If (pDoc.ComponentDefinition.HasMultipleSolidBodies = False) Then
            ' Check if its a sheetmetal part
            If (pDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then
                Dim oCompDefSM As SheetMetalComponentDefinition = oDoc.ComponentDefinition
                'Check if unfold exists. If not try to unfold
                If oCompDefSM.HasFlatPattern = False Then
                    oCompDefSM.Unfold()
                    oCompDefSM.FlatPattern.ExitEdit()
                    oCompDefSM.Document.Close(True)
                End If
            End If
        End If
    End If
Next&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Nov 2019 21:17:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9151668#M69516</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-11-17T21:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9151711#M69517</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;thank you very much. You are great. Everything works.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 22:03:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/9151711#M69517</guid>
      <dc:creator>dusan.naus.trz</dc:creator>
      <dc:date>2019-11-17T22:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674793#M175414</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;This Code is brilliant!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one request. Can we code it so that we can chose the A-side every time it unfolds a part in the assembly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need this because we Fold Galvanized panels with Bottom face having rough finish, which give us control on the overall look of the final assembly. And also for all the other materials we opt for majority of folds upwards from the A-side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence a human input is required when the A-side is chosen.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 13:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674793#M175414</guid>
      <dc:creator>ToniCoelhoE8VJF</dc:creator>
      <dc:date>2025-06-10T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674842#M175416</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15080314"&gt;@ToniCoelhoE8VJF&lt;/a&gt;.&amp;nbsp; The good news is yes, I think that is possible.&amp;nbsp; You would have to switch from using the regular&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SheetMetalComponentDefinition_Unfold" target="_blank" rel="noopener"&gt;SheetMetalComponentDefinition.Unfold&lt;/A&gt;&amp;nbsp;method, to using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SheetMetalComponentDefinition_Unfold2" target="_blank" rel="noopener"&gt;SheetMetalComponentDefinition.Unfold2&lt;/A&gt;&amp;nbsp;method, which asks for the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Face" target="_blank" rel="noopener"&gt;Face&lt;/A&gt; object to use as the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=FlatPattern_BaseFace" target="_blank" rel="noopener"&gt;FlatPattern.BaseFace&lt;/A&gt;.&amp;nbsp; You would most likely have to also include the '&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=CommandManager_Pick" target="_blank" rel="noopener"&gt;Pick&lt;/A&gt;' function, to pause the code for manual, mouse selection of a Face for it to use there.&amp;nbsp; But before calling that function, you would have to 'visibly' open each sheet metal part type document, because they are just being referenced in the background while another document is active in the example above.&amp;nbsp; This would be needed so that you can see it on your screen before picking one of its faces, because that earlier code example was just doing all that processing in the background.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 14:10:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674842#M175416</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-06-10T14:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674861#M175417</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;Can the above not be incorporated in the above code just so that it does all the tasks in the background, like opening the file&amp;gt;giving the popup to Pick the base face&amp;gt;closing the file&amp;gt; going onto the next sheetmetal part?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies, I am not fully iLogic Savy yet but building my expertise pas a pas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 14:27:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674861#M175417</guid>
      <dc:creator>ToniCoelhoE8VJF</dc:creator>
      <dc:date>2025-06-10T14:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674915#M175418</link>
      <description>&lt;P&gt;Yes.&amp;nbsp; The code can visibly open each sheet metal part as it comes to them, then prompt the user to manually click the mouse on a face of that part to use as the 'base face', then proceed to do the unfolding, and move on to the next part.&amp;nbsp; Or, if you had those specific faces 'named', then no manual user interactions would be needed at run time, and the code could just find the face by its name, and use that, without needing to visibly open each one, and without needing to prompt the user to pick a face for each one.&amp;nbsp; That named face route would require preparation ahead of time though.&amp;nbsp; When in a part, we can select a face, right-click on it, and choose 'Assign Name...' from the context menu, then assign a name to it.&amp;nbsp; That creates an attribute on that face that we can find by code later.&amp;nbsp; That works for faces, edges, and vertex objects.&lt;/P&gt;
&lt;P&gt;Below is an edited copy of Jelte's code example.&amp;nbsp; I added a line of code for visibly opening the sheet metal part only if it does not already have a flat pattern, and needs to be unfolded.&amp;nbsp; Then, I added a line of code to prompt the user to select a 'base face' for the unfold.&amp;nbsp; If something was picked, it will then try to unfold the part using that picked face.&amp;nbsp; Then it will try to visibly close that document.&amp;nbsp; Since this document is being referenced by the originally active document, it will not be fully closed, just visibly closed.&amp;nbsp; I have not tested this edited code, so proceed with caution.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim doc As Document = ThisApplication.ActiveDocument
'Loop through all referenced docs in assembly

For Each oDoc As Document In doc.AllReferencedDocuments
	' Check if its a part document 
	If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		Dim pDoc As PartDocument = oDoc
		' Check if there are multiple solid bodies
		If (pDoc.ComponentDefinition.HasMultipleSolidBodies = False) Then
			' Check if its a sheetmetal part
			If (pDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then
				Dim oCompDefSM As SheetMetalComponentDefinition = oDoc.ComponentDefinition
				'Check if unfold exists. If not try to unfold
				If oCompDefSM.HasFlatPattern = False Then
					'&amp;lt;&amp;lt;&amp;lt; VISIBLY OPENING THIS REFERENCED PART NOW &amp;gt;&amp;gt;&amp;gt;
					oDoc = ThisApplication.Documents.Open(oDoc.FullDocumentName, True)
					Dim oBaseFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Pick 'Base Face' for Unfold")
					If oBaseFace IsNot Nothing Then
						Try
							oCompDefSM.Unfold2(oBaseFace)
							oCompDefSM.FlatPattern.ExitEdit()
						Catch
							'what to do if that caused an error that got suppressed
						End Try
					End If
					Try
						oDoc.Close(True) 'True = skip save when closing (just closing visibly, not fully)
					Catch
					End Try
				End If
			End If
		End If
	End If
Next 'oDoc&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 14:55:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674915#M175418</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-06-10T14:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674930#M175419</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will now test this code and let you know the outcome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 15:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674930#M175419</guid>
      <dc:creator>ToniCoelhoE8VJF</dc:creator>
      <dc:date>2025-06-10T15:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674985#M175420</link>
      <description>&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6374092880112w1002h540r512" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6374092880112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6374092880112w1002h540r512');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6374092880112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;I have tested the code please see the above video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code seems to request a Base Face to be selected even though a A-Face is defined in the part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made the TEST assembly of 2 parts with one without A-Face being defined and other with A-Face defined.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 15:34:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13674985#M175420</guid>
      <dc:creator>ToniCoelhoE8VJF</dc:creator>
      <dc:date>2025-06-10T15:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13675035#M175422</link>
      <description>&lt;P&gt;I did not know that you wanted to consider that, since there was nothing about it in the original code, and no mention of it.&amp;nbsp; The A-Side Face seems to be a different property (&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=FlatPattern_ASideFace" target="_blank" rel="noopener"&gt;FlatPattern.ASideFace&lt;/A&gt;) of the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-FlatPattern" target="_blank" rel="noopener"&gt;FlatPattern&lt;/A&gt; than the BaseFace, because it can have a BaseFace without having an A-Side Face.&amp;nbsp; We can access those before the FlatPattern exists through the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=SheetMetalComponentDefinition_ASideDefinitions" target="_blank" rel="noopener"&gt;SheetMetalComponentDefinition.ASideDefinitions&lt;/A&gt;&amp;nbsp;property.&amp;nbsp; I assume then that after code checks if the part does not have a flat pattern, it should then check for the existence of that A-Side face, before prompting the user to select a face, and use that A-Side Face if it exists instead?&amp;nbsp;&amp;nbsp;If that is your intention, then we can set things up that way.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim doc As Document = ThisApplication.ActiveDocument
'Loop through all referenced docs in assembly

For Each oDoc As Document In doc.AllReferencedDocuments
	' Check if its a part document 
	If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		Dim pDoc As PartDocument = oDoc
		' Check if there are multiple solid bodies
		If (pDoc.ComponentDefinition.HasMultipleSolidBodies = False) Then
			' Check if its a sheetmetal part
			If (pDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}") Then
				Dim oCompDefSM As SheetMetalComponentDefinition = oDoc.ComponentDefinition
				'Check if unfold exists. If not try to unfold
				If oCompDefSM.HasFlatPattern = False Then
					Dim oBaseFace As Face = Nothing
					If oCompDefSM.ASideDefinitions.Count &amp;gt; 0 Then
						oBaseFace = oCompDefSM.ASideDefinitions.Item(1).ASideFace
					Else 'no A-Side Definitions, so have user pick a face
						'&amp;lt;&amp;lt;&amp;lt; VISIBLY OPENING THIS REFERENCED PART NOW &amp;gt;&amp;gt;&amp;gt;
						oDoc = ThisApplication.Documents.Open(oDoc.FullDocumentName, True)
						oBaseFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Pick 'Base Face' for Unfold")
					End If
					If oBaseFace IsNot Nothing Then
						Try
							oCompDefSM.Unfold2(oBaseFace)
							oCompDefSM.FlatPattern.ExitEdit()
						Catch
							'what to do if that caused an error that got suppressed
						End Try
					End If
					Try
						oDoc.Close(True) 'True = skip save when closing (just closing visibly, not fully)
					Catch
					End Try
				End If
			End If
		End If
	End If
Next 'oDoc&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 16:08:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13675035#M175422</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-06-10T16:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13675621#M175428</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_blank" rel="noopener"&gt;@WCrihfield good rule.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054" target="_blank" rel="noopener"&gt;I would try this one. This rule can run&amp;nbsp; from assembly or part. It allows you to pick face or A-Side first.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 23:20:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13675621#M175428</guid>
      <dc:creator>GosponZ</dc:creator>
      <dc:date>2025-06-10T23:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13676264#M175445</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;works like a gem as intended!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is folding the part with which has the A-face as intended. Can we code it to prompt us to create A-side instead of selecting BaseFace for the part which does not have A-side and then flat pattern it with the A-side created?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 12:51:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13676264#M175445</guid>
      <dc:creator>ToniCoelhoE8VJF</dc:creator>
      <dc:date>2025-06-11T12:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13678976#M175454</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1097622"&gt;@GosponZ&lt;/a&gt;.&amp;nbsp; Looks like a pretty long code process with a lot of separate code routines that took a lot of time to put together.&amp;nbsp; I will take your word for it that it works well, but I did not test it myself, because I'm a little short on time, and have no need for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15080314"&gt;@ToniCoelhoE8VJF&lt;/a&gt;.&amp;nbsp; Sure.&amp;nbsp; We can break away from the original code layout, and set this up in two code routines, giving the second one a few options for how it works, to make it a bit more dynamic.&amp;nbsp; A 'Main' code routine that simply deal with getting &amp;amp; supplying the current document and its referenced documents.&amp;nbsp; And a second routine for doing the unfold task, which lets us specify if we want to use the 'A-Side' definition, if one already exists, whether we want to 'prompt user to pick face, and whether we want to create a new A-SideDefinition using the manually picked face.&amp;nbsp; Once again, I have not tested this, so let me know if it works OK for you.&amp;nbsp; If you do not have your iLogic Log tab open, then it would probably be a good idea to show that before running this, then set your iLogic Log level to Trace (not necessarily detailed trace), that way, if it writes anything to the iLogic Log as feedback, it will be captured, and you can look in that tab after the code is done, to see if anything was written into it.&amp;nbsp; If a sheet metal part did not have a flat pattern, but was not modifiable for some reason, it writes a warning about that, to let you know.&amp;nbsp; Also, if an error happens while trying to unfold one of them, the error is written to that Log, instead of a MessageBox or Msg, to speed things up.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	Dim oDoc As Inventor.Document = ThisDoc.Document
	UnFoldSheetMetalPart(oDoc, True, True, True)
	For Each oRefDoc In oDoc.AllReferencedDocuments
		UnFoldSheetMetalPart(oRefDoc, True, True, True)
	Next
	oDoc.Update2(True)
End Sub

Sub UnFoldSheetMetalPart(doc As Inventor.Document, _
	Optional UseASideFaceIfAvailable As Boolean = False, _
	Optional PromptForFace As Boolean = False, _
	Optional CreateASideDefinition As Boolean = False)
	
	If (doc Is Nothing) OrElse (Not TypeOf doc Is PartDocument) Then Return
	Dim oPDoc As PartDocument = doc
	If Not TypeOf oPDoc.ComponentDefinition Is SheetMetalComponentDefinition Then Return
	Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
	If oSMDef.HasFlatPattern Then Return
	If Not oPDoc.IsModifiable Then
		Logger.Warn("Following sheet metal part with no FlatPattern was 'Not Modifiable':" _
		&amp;amp; vbCrLf &amp;amp; oPDoc.DisplayName)
		Return
	End If
	Dim oBaseFace As Face = Nothing
	Dim oASideFace As Face = Nothing
	Dim oNewView As Inventor.View = Nothing
	Dim oASideDefs As ASideDefinitions = oSMDef.ASideDefinitions
	If UseASideFaceIfAvailable = True Then
		If oASideDefs.Count &amp;gt; 0 Then
			oASideFace = oASideDefs.Item(1).ASideFace
			oBaseFace = oASideFace
		End If
	End If
	If PromptForFace = True Then
		If oBaseFace Is Nothing Then 
			'make the part visible, and the active document
			If oPDoc.Views.Count = 0 Then
				oNewView = oPDoc.Views.Add()
				oNewView.Activate()
			Else
				oPDoc.Views.Item(1).Activate()
			End If
			'prompt user to pick face
			oBaseFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Pick 'A-Side Face'")
			If oBaseFace Is Nothing Then Return
		End If
		If CreateASideDefinition = True Then
			oASideFace = oBaseFace
			'add an ASideDefinition for that face
			oASideDefs.Add(oASideFace)
		End If
	End If
	If oBaseFace Is Nothing Then
		Try
			oSMDef.Unfold()
		Catch ex As Exception
			Logger.Error("SheetMetalComponentDefinition.Unfold method error for:" &amp;amp; _
			vbCrLf &amp;amp; oPDoc.DisplayName &amp;amp; vbCrLf &amp;amp; ex.ToString())
		End Try
	Else
		Try
			oSMDef.Unfold2(oBaseFace)
		Catch ex As Exception
			Logger.Error("SheetMetalComponentDefinition.Unfold2 method error for:" &amp;amp; _
			vbCrLf &amp;amp; oPDoc.DisplayName &amp;amp; vbCrLf &amp;amp; ex.ToString())
		End Try
	End If
	If oNewView IsNot Nothing Then oNewView.Close()
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;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 14:43:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13678976#M175454</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-06-12T14:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679152#M175460</link>
      <description>&lt;P&gt;I understand you. I'm using daily, work for me. I just place if anybody want. You would probably fast tryout then that much you typed. I tried your rule and i say good rule, but not working for me&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 16:19:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679152#M175460</guid>
      <dc:creator>GosponZ</dc:creator>
      <dc:date>2025-06-12T16:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679193#M175461</link>
      <description>&lt;P&gt;I do design a lot of sheet metal parts using the sheet metal tools in Inventor, but I honestly rarely ever 'need' to unfold it or create a FlatPattern of it.&amp;nbsp; We outsource most sheet metal part fabrication that requires complex machining &amp;amp;/or bending to other local companies.&amp;nbsp; Since different fabrication companies can be using different tooling &amp;amp; production processes, the materials can get stretched or deformed in different ways, or result in slightly different internal/external radiuses in non-important places, so we leave our sheet metal settings (bend radius, kFactor, unfold rules) at (mostly) default settings, rarely include detailed flat pattern views in their drawings, and if we do, we point out that it is just for reference, and that the folded part specs are of primary concern.&amp;nbsp; In other words, we don't care how they get there, as long as the result meets the finished/folded part specs, and 'our" flat pattern may not be exactly what they would need to 'cut' before bending to get there.&lt;/P&gt;
&lt;P&gt;Because of this, I generally don't need any code based solutions for creating sheet metal flat patterns, or views of them, or DXF's of them...I just help others with their code for achieving those things because I understand most of what is involved, and like to help others when I have the time and resources to do so, while getting my other work done.&amp;nbsp; I usually learn quite a bit along the way too, which is a reward of its own, as well as getting faster at throwing similar codes together later, if needed.&amp;nbsp; Utilizing the custom iLogic Snippets for saving useful chunks of custom code also helps when assembling new custom codes faster, when needed.&amp;nbsp; Unfortunately, I haven't done the best job of also keeping URL Links to where I first posted or copied the original code chunk to/from, so that I can refer others back to it later, instead of just posting the code again somewhere else.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 17:00:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679193#M175461</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-06-12T17:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679307#M175462</link>
      <description>&lt;P&gt;I do lot flat pattern since we have laser and banding machine. In that rule whoever is using can use also in assemblies. I like people who like to share knowledge and help other people. Main reason of forum is to help who need help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as always i appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 18:19:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679307#M175462</guid>
      <dc:creator>GosponZ</dc:creator>
      <dc:date>2025-06-12T18:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Part contains Solidbody</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679417#M175467</link>
      <description>&lt;P&gt;I automated the code a little more. My problem is that I can't start writing code, I can read and edit, but starting is the hardest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"An Assembly Document must be active for this rule ("&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;RuleName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;") to work. Exiting."&lt;/SPAN&gt;, &lt;SPAN&gt;vbOKOnly&lt;/SPAN&gt; + &lt;SPAN&gt;vbCritical&lt;/SPAN&gt;, &lt;SPAN&gt;"Assembly functions (iam)"&lt;/SPAN&gt;)
		&lt;SPAN&gt;'MsgBox("Chybně spuštěn dialog! Špatný typ dokumentu." &amp;amp; vbLf &amp;amp; "OK pro Ukončení." &amp;amp; vbLf &amp;amp; "(" &amp;amp; iLogicVb.RuleName &amp;amp; ") ", vbOKOnly + vbCritical, "Funkce Sestavy (iam)")&lt;/SPAN&gt;
		&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&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;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
	&lt;SPAN&gt;UnFoldSheetMetalPart&lt;/SPAN&gt;(&lt;SPAN&gt;oDoc&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;True&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;oRefDoc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;AllReferencedDocuments&lt;/SPAN&gt;
		&lt;SPAN&gt;UnFoldSheetMetalPart&lt;/SPAN&gt;(&lt;SPAN&gt;oRefDoc&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;True&lt;/SPAN&gt;)
	&lt;SPAN&gt;Next&lt;/SPAN&gt;
	&lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Update2&lt;/SPAN&gt;(&lt;SPAN&gt;True&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;UnFoldSheetMetalPart&lt;/SPAN&gt;(&lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;, _
	&lt;SPAN&gt;Optional&lt;/SPAN&gt; &lt;SPAN&gt;UseASideFaceIfAvailable&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;Optional&lt;/SPAN&gt; &lt;SPAN&gt;PromptForFace&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;Optional&lt;/SPAN&gt; &lt;SPAN&gt;CreateASideDefinition&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;If&lt;/SPAN&gt; (&lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;) &lt;SPAN&gt;OrElse&lt;/SPAN&gt; (&lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Return&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN&gt;doc&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;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Return&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;oPDoc&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;Then&lt;/SPAN&gt; &lt;SPAN&gt;Return&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;IsModifiable&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;'        Logger.Warn("Soubor plechového dílu bez rozvinutí není modifikovatelný:" _&lt;/SPAN&gt;
		&lt;SPAN&gt;'        &amp;amp; vbCrLf &amp;amp; oPDoc.DisplayName)&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Following sheet metal part with no FlatPattern was 'Not Modifiable':"&lt;/SPAN&gt; _
		&amp;amp; &lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;)
		&lt;SPAN&gt;Return&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Face&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oASideFace&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Face&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oNewView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;View&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oASideDefs&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ASideDefinitions&lt;/SPAN&gt; = &lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;ASideDefinitions&lt;/SPAN&gt;

	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;UseASideFaceIfAvailable&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; (&lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;oASideDefs&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;) &lt;SPAN&gt;AndAlso&lt;/SPAN&gt; &lt;SPAN&gt;oASideDefs&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; &amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;oASideFace&lt;/SPAN&gt; = &lt;SPAN&gt;oASideDefs&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1).&lt;SPAN&gt;ASideFace&lt;/SPAN&gt;
			&lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; = &lt;SPAN&gt;oASideFace&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;If&lt;/SPAN&gt; &lt;SPAN&gt;PromptForFace&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;' Make the part visible and set it as the active document.&lt;/SPAN&gt;
			&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Views&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt; = 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
				&lt;SPAN&gt;oNewView&lt;/SPAN&gt; = &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Views&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;()
				&lt;SPAN&gt;oNewView&lt;/SPAN&gt;.&lt;SPAN&gt;Activate&lt;/SPAN&gt;()
			&lt;SPAN&gt;Else&lt;/SPAN&gt;
				&lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Views&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1).&lt;SPAN&gt;Activate&lt;/SPAN&gt;()
			&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

			&lt;SPAN&gt;' Automatic selection of the largest area (A-side) based on content&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oMaxFace&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Face&lt;/SPAN&gt; = &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;maxArea&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = 0

			&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oBody&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;
				&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&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;In&lt;/SPAN&gt; &lt;SPAN&gt;oBody&lt;/SPAN&gt;.&lt;SPAN&gt;Faces&lt;/SPAN&gt;
					&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;area&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;oFace&lt;/SPAN&gt;.&lt;SPAN&gt;Evaluator&lt;/SPAN&gt;.&lt;SPAN&gt;Area&lt;/SPAN&gt;
					&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;area&lt;/SPAN&gt; &amp;gt; &lt;SPAN&gt;maxArea&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
						&lt;SPAN&gt;maxArea&lt;/SPAN&gt; = &lt;SPAN&gt;area&lt;/SPAN&gt;
						&lt;SPAN&gt;oMaxFace&lt;/SPAN&gt; = &lt;SPAN&gt;oFace&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;Next&lt;/SPAN&gt;
			&lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; = &lt;SPAN&gt;oMaxFace&lt;/SPAN&gt;

			&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Return&lt;/SPAN&gt;
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;CreateASideDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;oASideFace&lt;/SPAN&gt; = &lt;SPAN&gt;oBaseFace&lt;/SPAN&gt;
			&lt;SPAN&gt;' Add an A-side definition for this surface&lt;/SPAN&gt;
			&lt;SPAN&gt;oASideDefs&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oASideFace&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;If&lt;/SPAN&gt; &lt;SPAN&gt;oBaseFace&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;Try&lt;/SPAN&gt;
			&lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;Unfold&lt;/SPAN&gt;()
		&lt;SPAN&gt;Catch&lt;/SPAN&gt; &lt;SPAN&gt;ex&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Exception&lt;/SPAN&gt;
			&lt;SPAN&gt;'            Logger.Error("Chyba při volání SheetMetalComponentDefinition.Unfold pro:" &amp;amp; _&lt;/SPAN&gt;
			&lt;SPAN&gt;'            vbCrLf &amp;amp; oPDoc.DisplayName &amp;amp; vbCrLf &amp;amp; ex.ToString())&lt;/SPAN&gt;
			&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"SheetMetalComponentDefinition.Unfold method error for:"&lt;/SPAN&gt; &amp;amp; _
			&lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ex&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;())
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;Try&lt;/SPAN&gt;
			&lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;Unfold2&lt;/SPAN&gt;(&lt;SPAN&gt;oBaseFace&lt;/SPAN&gt;)
		&lt;SPAN&gt;Catch&lt;/SPAN&gt; &lt;SPAN&gt;ex&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Exception&lt;/SPAN&gt;
			&lt;SPAN&gt;'            Logger.Error("Chyba při volání SheetMetalComponentDefinition.Unfold2 pro:" &amp;amp; _&lt;/SPAN&gt;
			&lt;SPAN&gt;'            vbCrLf &amp;amp; oPDoc.DisplayName &amp;amp; vbCrLf &amp;amp; ex.ToString())&lt;/SPAN&gt;
			&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"SheetMetalComponentDefinition.Unfold2 method error for:"&lt;/SPAN&gt; &amp;amp; _
			&lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oPDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DisplayName&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;ex&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;())
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oNewView&lt;/SPAN&gt; &lt;SPAN&gt;IsNot&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;oNewView&lt;/SPAN&gt;.&lt;SPAN&gt;Close&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;</description>
      <pubDate>Thu, 12 Jun 2025 20:18:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-part-contains-solidbody/m-p/13679417#M175467</guid>
      <dc:creator>dusan.naus.trz</dc:creator>
      <dc:date>2025-06-12T20:18:53Z</dc:date>
    </item>
  </channel>
</rss>

