Vb.Net - Change the color of a part (ipt) using RGB values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help?
I have the following VBA macro that changes the color of a part (ipt) using RGB values.
Function ChangeColour()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oAppearence As Asset
Set oAppearence = oDoc.Assets.Add(kAssetTypeAppearance, "Generic")
Dim oColor As ColorAssetValue
Set oColor = oAppearence.Item("generic_diffuse")
Red = 0
Green = 145
Blue = 255
oColor.Value = ThisApplication.TransientObjects.CreateColor(Red, Green, Blue)
Dim oExtFeats As ExtrudeFeatures
Set oExtFeats = oDoc.ComponentDefinition.Features.ExtrudeFeatures
If oExtFeats.Count = 0 Then Return
Dim oExtrude1 As ExtrudeFeature
Set oExtrude1 = oExtFeats.Item(1)
oExtrude1.Appearance = oAppearence
End Function
Can anybody change the macro so that it can work using a "Stand Alone" Vb.Net program?
Many thanks in advance!
Darren