<?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: Check all Parameter from assembly by Regenerate Ilogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062827#M21917</link>
    <description>&lt;P&gt;&lt;U&gt;That's greate. It's very helpful for me. Bro. &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;It worked well. But it showed a messages. Is there any change to remove messages. &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: Check box mirror part, in document: Assembly3.iam&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 07:00:16 GMT</pubDate>
    <dc:creator>tamnn.designer</dc:creator>
    <dc:date>2023-06-27T07:00:16Z</dc:date>
    <item>
      <title>Check all Parameter from assembly by Regenerate Ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062559#M21915</link>
      <description>&lt;P&gt;I have many mirror part but they are not automatically check the parameter box as original part. Could you please help me to create a ilogic to check all parameter from regenerate at 3D assembly file.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 04:27:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062559#M21915</guid>
      <dc:creator>tamnn.designer</dc:creator>
      <dc:date>2023-06-27T04:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Check all Parameter from assembly by Regenerate Ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062793#M21916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5131252"&gt;@tamnn.designer&lt;/a&gt;&amp;nbsp;.&amp;nbsp;If you need to add a check box to the parameters of your MirrorPart, then in line 2 &lt;STRONG&gt;bRef = True&lt;/STRONG&gt;, if you need to remove the check box, set the value &lt;STRONG&gt;bRef = False&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Private Sub Main()
	Dim bRef As Boolean = True
	Dim oDoc As Document = ThisApplication.ActiveDocument
	Dim oTM As Transaction = ThisApplication.TransactionManager.StartTransaction(oDoc, "CheckMirroredPart")
	If TypeOf oDoc Is AssemblyDocument Then
		Dim oAsmDoc As AssemblyDocument = oDoc
		Call GetAllRefDoc(oAsmDoc, bRef)
	Else If TypeOf oDoc Is PartDocument Then
		Dim oPartDoc As PartDocument = oDoc
		Call CheckMirroredPart(oPartDoc, bRef)
	End If
	oTM.End()
End Sub

Private Sub GetAllRefDoc(ByVal oAsmDoc As AssemblyDocument, ByVal bRef As Boolean)
	Dim oOccs As ComponentOccurrences = oAsmDoc.ComponentDefinition.Occurrences
	For Each oRefDoc As Document In oAsmDoc.AllReferencedDocuments
		If oOccs.AllReferencedOccurrences(oRefDoc).Count &amp;gt; 0 Then
			Dim oOcc As ComponentOccurrence = oOccs.AllReferencedOccurrences(oRefDoc)(1)
			If oOcc.Suppressed Then Continue For
			If oOcc.DefinitionDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Continue For
			Call CheckMirroredPart(oOcc.Definition.Document, bRef)
		End If
	Next
End Sub

Private Function CheckMirroredPart(oDoc As PartDocument, ByVal bRef As Boolean)
	If Not oDoc.IsModifiable Then Exit Function
	If oDoc.ComponentDefinition.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject Then
		Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
		If oDef.ReferenceComponents.DerivedPartComponents(1).Definition.Mirror Then
			If oDef.Parameters.DerivedParameterTables.Count = 0 Then Exit Function
			Dim oDerivedParams As DerivedParameters = oDef.Parameters.DerivedParameterTables.Item(1).DerivedParameters
			If oDerivedParams.Count = 0 Then Exit Function
			For i As Integer = 1 To oDerivedParams.Count
				If oDerivedParams(i).ExposedAsProperty &amp;lt;&amp;gt; bRef Then oDerivedParams(i).ExposedAsProperty = bRef
			Next i
		End If
	End If
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 06:45:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062793#M21916</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-06-27T06:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Check all Parameter from assembly by Regenerate Ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062827#M21917</link>
      <description>&lt;P&gt;&lt;U&gt;That's greate. It's very helpful for me. Bro. &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;It worked well. But it showed a messages. Is there any change to remove messages. &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: Check box mirror part, in document: Assembly3.iam&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:00:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062827#M21917</guid>
      <dc:creator>tamnn.designer</dc:creator>
      <dc:date>2023-06-27T07:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Check all Parameter from assembly by Regenerate Ilogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062866#M21918</link>
      <description>&lt;P&gt;I tried to optimize the code and remove rudimentary lines of code, hope this helps you. If that doesn't help you, then send your files if possible.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Private Sub Main()
	Dim bRef As Boolean = True
	Dim oDoc As Document = ThisApplication.ActiveDocument
	Dim oTM As Transaction = ThisApplication.TransactionManager.StartTransaction(oDoc, "CheckMirroredPart")
	If TypeOf oDoc Is AssemblyDocument Then
		Dim oAsmDoc As AssemblyDocument = oDoc
		Call GetAllRefDoc(oAsmDoc, bRef)
	Else If TypeOf oDoc Is PartDocument Then
		Dim oPartDoc As PartDocument = oDoc
		Call CheckMirroredPart(oPartDoc, bRef)
	End If
	oTM.End()
End Sub

Private Sub GetAllRefDoc(ByVal oAsmDoc As AssemblyDocument, ByVal bRef As Boolean)
	Dim oOccs As ComponentOccurrences = oAsmDoc.ComponentDefinition.Occurrences
	For Each oRefDoc As Document In oAsmDoc.AllReferencedDocuments
		If oOccs.AllReferencedOccurrences(oRefDoc).Count &amp;gt; 0 Then
			If oRefDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Continue For
			Call CheckMirroredPart(oRefDoc, bRef)
		End If
	Next
End Sub

Private Function CheckMirroredPart(oDoc As PartDocument, ByVal bRef As Boolean)
	If Not oDoc.IsModifiable Then Exit Function
	Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
	If oDef.ReferenceComponents.DerivedPartComponents(1).Definition.Mirror Then
		If oDef.Parameters.DerivedParameterTables.Count = 0 Then Exit Function
		Dim oDerivedParams As DerivedParameters = oDef.Parameters.DerivedParameterTables.Item(1).DerivedParameters
		If oDerivedParams.Count = 0 Then Exit Function
		For i As Integer = 1 To oDerivedParams.Count
			If oDerivedParams(i).ExposedAsProperty &amp;lt;&amp;gt; bRef Then oDerivedParams(i).ExposedAsProperty = bRef
		Next i
	End If
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:12:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/check-all-parameter-from-assembly-by-regenerate-ilogic/m-p/12062866#M21918</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-06-27T07:12:36Z</dc:date>
    </item>
  </channel>
</rss>

