Autodesk Inventor Vb.Net "AddIn" - Set Part Colour Using RGB Values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help?
I am writing a Autodesk Inventor Vb.Net "AddIn" to set the part colour using RGB Values.
Here is my code so far....
Imports Inventor
Module Module01
Sub SetPartColour(oDoc As Document)
Dim invApp As Inventor.Application = ThisApplication
Dim oAppearance As Asset = oDoc.Assets.Add(AssetTypeEnum.kAssetTypeAppearance, "CustomAppearance")
Dim oColor As ColorAssetValue = oAppearance.Item("generic_diffuse")
Dim red As Byte = 255
Dim green As Byte = 0
Dim blue As Byte = 0
Dim oColorObj As Color = invApp.TransientObjects.CreateColor(red, green, blue)
oColor.Value = oColorObj
Dim oExtrudeFeature As ExtrudeFeature = oDoc.ComponentDefinition.Features.ExtrudeFeatures.Item(1)
oExtrudeFeature.Appearance = oAppearance
End Sub
End Module
I am having issues in the above code, highlighted in red.
Does anybody know what is wrong, and can you update the code?
Many thanks in advance!
Darren