I want to change color RGB using iLogic for inventor studio

I want to change color RGB using iLogic for inventor studio

jhp0922_park
Explorer Explorer
291 Views
0 Replies
Message 1 of 1

I want to change color RGB using iLogic for inventor studio

jhp0922_park
Explorer
Explorer

I want to change color RGB using iLogic for inventor studio. 

I would appreciate it if you could give me a solution for my work.

oName = "painting blue"
oRed = Red
oGreen = Green
oBlue = Blue

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oAppearance As Asset
'get active appearance
oAppearance = oDoc.ActiveAppearance

'create new appearance named painting blue
If Not oDoc.ActiveAppearance.DisplayName = oName Then
	oAppearance = oDoc.Assets.Add(AssetTypeEnum.kAssetTypeAppearance, "Generic", "Appearances", oName)
	'set new appearance active
	oDoc.ActiveAppearance = oAppearance	
End If

'set colors
Dim oColor As ColorAssetValue
oColor = oAppearance.Item("Color Setter 2019:1")
oColor.Value = ThisApplication.TransientObjects.CreateColor(oRed, oGreen, oBlue)
0 Likes
292 Views
0 Replies
Replies (0)