<?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: Flipping component pattern in assemblies with iLogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055237#M101251</link>
    <description>&lt;P&gt;I received an error using this one, but I probably overlooked or mistakenly edited the code improperly to fit my situation. Since the code posted above worked, I didn't chase down the error. I still want to thank you for your help though...&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2017 13:36:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-02T13:36:59Z</dc:date>
    <item>
      <title>Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7053469#M101246</link>
      <description>&lt;P&gt;I have an assembly with a component pattern that I want to flip the direction with iLogic (or other rule type) by reading a multivalue parameter which reads either "LEFT" or "RIGHT". Can this be done?&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 18:19:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7053469#M101246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-01T18:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055064#M101247</link>
      <description>&lt;P&gt;Hello and welcome to the community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the pattern you are changing a rectangular pattern? and&amp;nbsp;if so is it just the the column direction you want to change?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 12:44:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055064#M101247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T12:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055176#M101248</link>
      <description>&lt;P&gt;Dim oDoc As AssemblyDocument&lt;BR /&gt;oDoc = ThisApplication.ActiveDocument&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oAsmCompDef As AssemblyComponentDefinition&lt;BR /&gt;oAsmCompDef = oDoc.ComponentDefinition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim oOccPat As OccurrencePattern&lt;BR /&gt;oOccPat = oAsmCompDef.OccurrencePatterns.Item(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If parameter = "LEFT" Then&lt;/P&gt;
&lt;P&gt;oOccPat.ColumnEntityNaturalDirection = False&lt;/P&gt;
&lt;P&gt;Else&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;oOccPat.ColumnEntityNaturalDirection = True&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have more than one pattern, you may want to define the pattern by its name rather than item number. In that instance you would use:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;oOccPat = oAsmCompDef.OccurrencePatterns.Item("&lt;EM&gt;Component Pattern Name&lt;/EM&gt;")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 13:25:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055176#M101248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T13:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055178#M101249</link>
      <description>&lt;P&gt;(This must be posted exactly at the same moment as someone else)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in 2015 i could not use a multivalue parameter, so i used a True/False paramer, this may be altered if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub FlipPattern()

Dim oIamDoc As AssemblyDocument
Set oIamDoc = ThisApplication.ActiveDocument

Dim oIamDocDef As AssemblyComponentDefinition
oIamDocDef = oIamDoc.ComponentDefinition

Dim oRecPattern As RectangularOccurrencePattern
oRecPattern = oIamDocDef.OccurrencePatterns("Component Pattern 1:1")  'Change as needed

Dim oUserParamDirection As UserParameter
oUserParamDirection = oIamDocDef.Parameters.UserParameters.Item("Direction")

If oUserParamDirection.Value = "True" Then 'Change as needed
    oRecPattern.ColumnEntityNaturalDirection = True
Else
    oRecPattern.ColumnEntityNaturalDirection = False
End If

End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 13:16:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055178#M101249</guid>
      <dc:creator>frederic.vandenplas</dc:creator>
      <dc:date>2017-05-02T13:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055228#M101250</link>
      <description>&lt;P&gt;This worked beautifully...thank you&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 13:33:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055228#M101250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T13:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055237#M101251</link>
      <description>&lt;P&gt;I received an error using this one, but I probably overlooked or mistakenly edited the code improperly to fit my situation. Since the code posted above worked, I didn't chase down the error. I still want to thank you for your help though...&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 13:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055237#M101251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T13:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055292#M101252</link>
      <description>&lt;P&gt;Set oIamDoc = ThisApplication.ActiveDocument&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Removing the word &lt;EM&gt;Set&amp;nbsp;&lt;/EM&gt; from this line would probably fix the error.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 13:52:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7055292#M101252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-02T13:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7705307#M101253</link>
      <description>&lt;P&gt;I'm having trouble with this I have a circular pattern that is not working for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&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;AssemblyDocument&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;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;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOccPat&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;OccurrencePattern&lt;/SPAN&gt;
&lt;SPAN&gt;oOccPat&lt;/SPAN&gt; = &lt;SPAN&gt;oAsmCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;OccurrencePatterns&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"NubSupportPattern"&lt;/SPAN&gt;)

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;OrientationNumeric&lt;/SPAN&gt; = 1 &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;oOccPat&lt;/SPAN&gt;.&lt;SPAN&gt;ColumnEntityNaturalDirection&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt;
&lt;SPAN&gt;oOccPat&lt;/SPAN&gt;.&lt;SPAN&gt;ColumnEntityNaturalDirection&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;/PRE&gt;&lt;P&gt;ERROR MESSAGE:&lt;/P&gt;&lt;P&gt;Error in rule: Orientation, in document: Tray Stack, Top_HC3.iam&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;INFO:&lt;/P&gt;&lt;P&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.OccurrencePatterns.get_Item(Object Index)&lt;BR /&gt;at LmiRuleScript.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 22:05:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7705307#M101253</guid>
      <dc:creator>josephcooley</dc:creator>
      <dc:date>2018-01-19T22:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7709925#M101254</link>
      <description>&lt;P&gt;I am trying to do flip a circular pattern does that make a difference?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 17:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7709925#M101254</guid>
      <dc:creator>josephcooley</dc:creator>
      <dc:date>2018-01-22T17:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7712084#M101255</link>
      <description>&lt;P&gt;Not able to test it myself, but I think if you change&amp;nbsp;ColumnEntityNaturalDirection to&amp;nbsp;AxisEntityNaturalDirection it will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found that via the API help:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-1C7846A1-15A4-4C97-9C0B-B2F852A927D3" target="_blank"&gt;http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-1C7846A1-15A4-4C97-9C0B-B2F852A927D3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 09:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7712084#M101255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-23T09:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7713217#M101256</link>
      <description>&lt;P&gt;Perfect that worked exactly as intended thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 15:36:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7713217#M101256</guid>
      <dc:creator>josephcooley</dc:creator>
      <dc:date>2018-01-23T15:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7713317#M101257</link>
      <description>&lt;P&gt;This worked for one assembly but I have a circular pattern nested within a linear pattern in another assembly and its not working correctly. its giving me this message below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;/P&gt;&lt;P&gt;Error in rule: Orientation, in document: Tray Stack, Bottom_HC3.iam&lt;/P&gt;&lt;P&gt;The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More Info&lt;/P&gt;&lt;P&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;BR /&gt;at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;at Inventor.OccurrencePatterns.get_Item(Object Index)&lt;BR /&gt;at LmiRuleScript.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a screenshot of the model tree structure.&amp;nbsp; The "rotational pattern" is the one I want to switch within the "Linear Pattern"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;trigger&lt;/SPAN&gt; = &lt;SPAN&gt;OrientationNumeric&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPattern&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;CircularOccurrencePattern&lt;/SPAN&gt;
&lt;SPAN&gt;oPattern&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;OccurrencePatterns&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Rotational Pattern"&lt;/SPAN&gt;)

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;OrientationNumeric&lt;/SPAN&gt; = 0 &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;oPattern&lt;/SPAN&gt;.&lt;SPAN&gt;AxisEntityNaturalDirection&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; 
&lt;SPAN&gt;Else&lt;/SPAN&gt;
	&lt;SPAN&gt;oPattern&lt;/SPAN&gt;.&lt;SPAN&gt;AxisEntityNaturalDirection&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; 
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 15:59:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/7713317#M101257</guid>
      <dc:creator>josephcooley</dc:creator>
      <dc:date>2018-01-23T15:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping component pattern in assemblies with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/8599383#M101258</link>
      <description>&lt;P&gt;I am working on something similar, except I would like to reverse the direction of a feature pattern within a part.&amp;nbsp;&amp;nbsp; How&amp;nbsp;do I define the features within the part?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 20:02:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flipping-component-pattern-in-assemblies-with-ilogic/m-p/8599383#M101258</guid>
      <dc:creator>jfenter</dc:creator>
      <dc:date>2019-02-15T20:02:57Z</dc:date>
    </item>
  </channel>
</rss>

