<?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 Change Tube Run Color in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7120121#M276751</link>
    <description>&lt;P&gt;Once you create them in your T &amp;amp; P Template, they are there as long as you save, migrate and paste the Template T &amp;amp; P into the new Inventor template file.&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2017 16:22:39 GMT</pubDate>
    <dc:creator>blair</dc:creator>
    <dc:date>2017-05-31T16:22:39Z</dc:date>
    <item>
      <title>iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7118127#M276747</link>
      <description>&lt;P&gt;I'm having trouble changing the color of my tube runs using iLogic. I have an assembly, I've created a tube run within this assembly, and when I try to run the code below at the assembly level the code doesn't work. However, if I open the "Tube and Pipe Runs" file and put the same code in there it works. The problem is that the "Tube and Pipe Runs" file does not pass the overrides back up the the parent assembly file.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Component.Color("Run01") = "red"
Component.Color("Run02") = "green"&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tube and pipe level.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/361703i8494070E77581554/image-size/large?v=v2&amp;amp;px=999" role="button" title="tube and pipe level.gif" alt="tube and pipe level.gif" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="upper assembly containing tube run.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/361704iDD941F41958012C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="upper assembly containing tube run.gif" alt="upper assembly containing tube run.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 21:32:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7118127#M276747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T21:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7118619#M276748</link>
      <description>&lt;P&gt;You will probably need to change you approach on this. T &amp;amp; P works with "Styles" to change the color of runs and keep them. You would need to have created the "Styles" for each color within your T &amp;amp; P Template File and then have your iLogic select the correct Style.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 04:47:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7118619#M276748</guid>
      <dc:creator>blair</dc:creator>
      <dc:date>2017-05-31T04:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7119558#M276749</link>
      <description>&lt;P&gt;We have a lot of styles(about 25) and we have at least 8 different colors for each style. I was looking for something a little quicker than creating a style for each color. If this is the only option then so be it but I would like to program something. Maybe I can create a routine that creates the styles for me?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 13:33:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7119558#M276749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-31T13:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7119640#M276750</link>
      <description>&lt;P&gt;What if I have to place an elbow from Content Center?&amp;nbsp; I believe your approach will only work for auto routes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 13:57:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7119640#M276750</guid>
      <dc:creator>Cris_Davis</dc:creator>
      <dc:date>2017-05-31T13:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7120121#M276751</link>
      <description>&lt;P&gt;Once you create them in your T &amp;amp; P Template, they are there as long as you save, migrate and paste the Template T &amp;amp; P into the new Inventor template file.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 16:22:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7120121#M276751</guid>
      <dc:creator>blair</dc:creator>
      <dc:date>2017-05-31T16:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7129061#M276752</link>
      <description>&lt;P&gt;Cris, maybe you post how we solved this problem? or the approach we took.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 13:17:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7129061#M276752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-05T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Change Tube Run Color</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7129296#M276753</link>
      <description>&lt;P&gt;@ phillip.shields&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know you were asking for another solution that SiloMan explained offline, but I'll add this iLogic just in case it helps others in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;( Note we just finished this up on Friday, so it might not be fully rolled out internally yet.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;' Get the active document.  
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Get the UserParameters collection
Dim userParams As UserParameters
userParams = oDoc.ComponentDefinition.Parameters.UserParameters

'[ check For Parameter And create If Not found
Try
	oTest = Parameter("Color_List") 
Catch
	oParam = userParams.AddByValue("Color_List","Black", UnitsTypeEnum.kTextUnits)
End Try

'create color list
Dim ColorArrayList As New ArrayList
ColorArrayList.Clear
ColorArrayList.add("Black")
ColorArrayList.add("White")
ColorArrayList.add("Red")
ColorArrayList.add("Yellow")
ColorArrayList.add("Cyan")
ColorArrayList.add("Magenta")


MultiValue.List("Color_List") = ColorArrayList
']

'[ create list of runs
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim MyArrayList As New ArrayList

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef)  
	 oDef = oOccurrence.Definition.Document
	Dim bIsRunDocument As Boolean
	bIsRunDocument = oDef.DocumentInterests.HasInterest("Piping Run Environment")
	

	If bIsRunDocument = True Then
		MyArrayList.add( oOccurrence.Name )
	End If
Next


'check For Parameter And create If Not found
Try
	oTest = Parameter("Runs_List") 
Catch
	oParam = userParams.AddByValue("Runs_List","", UnitsTypeEnum.kTextUnits)
End Try

'] MultiValue.List("Runs_List") = MyArrayList


oColor = Color_List
oRun = Runs_List

'[ try to get the named asset / color
Dim localAsset As Asset

Try 
	localAsset = oDoc.Assets.Item(oColor)
Catch

	
	Dim assetLib As AssetLibrary
	assetLib = ThisApplication.AssetLibraries.Item("APPEAR")
	
	Dim libAsset As Asset
	libAsset = assetLib.AppearanceAssets.Item(oColor)
	
	' Copy the asset locally.
	localAsset = libAsset.CopyTo(ThisApplication.ActiveDocument)
End Try
'] 

'set the color of the run 
For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef)  	
	If oOccurrence.Name = oRun Then			
		oOccurrence.Appearance = localAsset					
	End If
Next


&lt;/PRE&gt;
&lt;P&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/2599b17a-abb1-48a5-bc3f-51744804ab76" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" width="696" height="625" frameborder="0"&gt;&lt;/IFRAME&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 16:56:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/ilogic-change-tube-run-color/m-p/7129296#M276753</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2017-06-05T16:56:05Z</dc:date>
    </item>
  </channel>
</rss>

