Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi @neodd70 ,

 

In addition to JelteDeJong's observation, the other thing that I noticed, is that it seems that maybe the sketch needs to have at least one entity before the color can be applied? maybe?

 

I was able to get this example to work, if I set the option to project the face into the sketch to True

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim ThisDoc As PartDocument = ThisApplication.ActiveDocument
Dim CompDef As PartComponentDefinition = ThisDoc.ComponentDefinition
Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick Face")
Dim oSketch As Sketch = CompDef.Sketches.Add(oFace, True)

Dim oColor As Inventor.Color
oColor = ThisApplication.TransientObjects.CreateColor(0, 255, 0)
oSketch.Color = oColor
ThisDoc.Update