<?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 Color as parameter in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10988515#M135232</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;Could anyone help me how can I set a color as parameter in inventor?&lt;BR /&gt;I'd like to use it to automatic filling up "color" in drawing table. Maybe do you have any iLogic rule for this?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 12:54:22 GMT</pubDate>
    <dc:creator>michalCDNJV</dc:creator>
    <dc:date>2022-03-07T12:54:22Z</dc:date>
    <item>
      <title>Color as parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10988515#M135232</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Could anyone help me how can I set a color as parameter in inventor?&lt;BR /&gt;I'd like to use it to automatic filling up "color" in drawing table. Maybe do you have any iLogic rule for this?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:54:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10988515#M135232</guid>
      <dc:creator>michalCDNJV</dc:creator>
      <dc:date>2022-03-07T12:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Color as parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10988987#M135241</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9710298"&gt;@michalCDNJV&lt;/a&gt;.&amp;nbsp; The value of a UserParameter can only be either a number, a String (text), or Boolean (True/False), so you can't actually set its value as a Color directly.&amp;nbsp; You can have the UserParameter's value be the text representing the name of a color.&amp;nbsp; When you create a color object in code, you usually specify 3 to 4 aspects of the color (amount of Red, the amount of Green, and the amount of Blue, each as a number between 0 and 255), then optionally the amount of opacity (as a Double), which ranges from zero (0) to 1 (0 = completely translucent &amp;amp; 1 = completely&amp;nbsp; opaque).&amp;nbsp; And it won't let you store 3 or 4 numbers all as one current value, unless you put it all as one long string (text).&amp;nbsp; Can you please explain more about what you are trying to achieve, so maybe we can help you come up with some alternative ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 16:08:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10988987#M135241</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-03-07T16:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Color as parameter</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10990330#M135251</link>
      <description>&lt;P&gt;Yes you can do this with Ilogic. What you need to make sure is that spell corrently ( that make it easy anyway).&amp;nbsp; I do not have at code you need 100 % but here is some code that might give you some idear(for&amp;nbsp;assembly &amp;nbsp;first code)&amp;nbsp; and&amp;nbsp; Part second code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also make it color all view.&amp;nbsp; &amp;nbsp;but I have try to copy and paste as lillte code I could in a short time ... hope it help&lt;/P&gt;&lt;LI-CODE lang="general"&gt;//assembly

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAsmDoc.ComponentDefinition

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences

	Component.Color(oOccurrence.name)="RAL 5003 Sapphire blue"
	iLogicVb.UpdateWhenDone = True 

Next
End if 


End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub Colour1
Dim oPartDoc As PartDocument 

	Try
	oPartDoc = ThisApplication.ActiveDocument 
	Catch
	oPartDoc =	ThisDoc.Document
	End Try

	'define the appearance library
	Dim oLib As AssetLibrary
	oLib = ThisApplication.AssetLibraries("KallesoeMaterialLibrary")

	'make sure colors are in assembly doc
	Dim libAsset As Asset
	 
	libAsset = oLib.AppearanceAssets.Item("RAL 9010 Pure white")
	

	Dim localAsset As Asset 
	Try  

localAsset = oPartDoc.Assets.Item("RAL 9010 Pure white")


		
	Catch 
		
		localAsset = libAsset.CopyTo(oPartDoc)
	End Try 
	
	oPartDoc.ActiveAppearance = localAsset

	
	
	End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 06:00:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/color-as-parameter/m-p/10990330#M135251</guid>
      <dc:creator>Darkforce_the_ilogic_guy</dc:creator>
      <dc:date>2022-03-08T06:00:58Z</dc:date>
    </item>
  </channel>
</rss>

