<?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: Control LevelOfDetail with positions and Ilogic? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12568523#M163889</link>
    <description>&lt;P&gt;BUMP&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 07:25:45 GMT</pubDate>
    <dc:creator>david_alcalde6P6BN</dc:creator>
    <dc:date>2024-02-19T07:25:45Z</dc:date>
    <item>
      <title>Control LevelOfDetail with positions and Ilogic?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12562428#M163782</link>
      <description>&lt;P&gt;Hi everyone, I need help,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have learn a little bit of ilogic by myself and I managed with the forum and googles help to write (or copy and modify bits and combine) some macros to make my life easier, but I am lost now.&lt;/P&gt;&lt;P&gt;I have been trying for a couple of days to link the position of my assemblies with the level of detail and I can't make it work.&lt;/P&gt;&lt;P&gt;I have several positions called LVL1, LVL2.... and so on and levels of detail called the same, the asembly moves to the LVL1 position and I am trying that the LevelOfDetail changes automatically accordingly but it seems just impossible.&lt;/P&gt;&lt;P&gt;I have been searching the forum and found some code, but nothing seems to work properly. (Some rules work, but the trigger does not)&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
	If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "LVL1" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("LVL1").Activate
	Else If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "LVL2" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("LVL2").Activate
	Else If oAsmCompDef.RepresentationsManager.ActiveLevelOfDetailRepresentation.Name = "LVL3" Then
oAsmCompDef.RepresentationsManager.PositionalRepresentations.Item("LVL3").Activate
	End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;    Dim oAsmDoc As AssemblyDocument
     oAsmDoc = ThisApplication.ActiveDocument
    
    Dim oAsmDef As AssemblyComponentDefinition
     oAsmDef = ThisApplication.ActiveDocument.ComponentDefinition
    
    Dim oC As ComponentOccurrences
     oC = oAsmDef.Occurrences
    
    Dim oOcc As ComponentOccurrence
    
    Dim pos As Integer
    pos = 1
    Dim oPosRep As PositionalRepresentation
     oPosRep = oAsmDef.RepresentationsManager.PositionalRepresentations("LVL1")
    For Each oOcc In oC
         If pos = 1 Then
            Call oPosRep.SetPositionalRepresentationOverride(oOcc, "LVL1")
            pos = 0
        Else
            Call oPosRep.RemovePositionalRepresentationOverride(oOcc)
            pos = 1
        End If
    Next&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The first code works, (it does it's thing the other way round, I wish to activate the position to make the level of detail change, but I will be happy with that if there is no way to make it the other way) but it does not trigger automatically, I have to run the rule manually; I tried with events and nothing, then found something called "&lt;STRONG&gt;OnActivatePositionalRepresentation&lt;/STRONG&gt;" wich seemed promising but I know very little of ilogic and it seems I cannot make it work.&lt;BR /&gt;The secong I didn't manage it to make it work at all but was somewhere in the forum as a solution...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks to everyone, hope you can help me&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 15:35:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12562428#M163782</guid>
      <dc:creator>david_alcalde6P6BN</dc:creator>
      <dc:date>2024-02-15T15:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Control LevelOfDetail with positions and Ilogic?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12568523#M163889</link>
      <description>&lt;P&gt;BUMP&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 07:25:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12568523#M163889</guid>
      <dc:creator>david_alcalde6P6BN</dc:creator>
      <dc:date>2024-02-19T07:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Control LevelOfDetail with positions and Ilogic?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12578298#M164105</link>
      <description>&lt;P&gt;BUMP&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 12:34:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12578298#M164105</guid>
      <dc:creator>david_alcalde6P6BN</dc:creator>
      <dc:date>2024-02-23T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Control LevelOfDetail with positions and Ilogic?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12578741#M164123</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14865999"&gt;@david_alcalde6P6BN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can likely make this work by having a local parameter in the assembly file trigger the rule to run. Events for these types of specific objects are rare and are difficult to achieve without going into to addin territory.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steps to follow&lt;/P&gt;&lt;P&gt;1. Create a local parameter to store your options value.&lt;/P&gt;&lt;P&gt;2. Add this parameter to the rule and monitor it's status. As it is changes in the form this triggers the rule to run.&lt;/P&gt;&lt;P&gt;3. Change your code to activate the positional rep first then the level of detail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A step I always do before hand is to ensure the exact workflow is achievable manually before attempting to write the steps to automate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 15:24:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12578741#M164123</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2024-02-23T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Control LevelOfDetail with positions and Ilogic?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12582732#M164168</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7946284"&gt;@A.Acheson&lt;/a&gt;&amp;nbsp;, I'll try and wether if I make it work or not, I'll post the followup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 09:52:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/control-levelofdetail-with-positions-and-ilogic/m-p/12582732#M164168</guid>
      <dc:creator>david_alcalde6P6BN</dc:creator>
      <dc:date>2024-02-26T09:52:09Z</dc:date>
    </item>
  </channel>
</rss>

