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

Having trouble setting Sketch Color in a part

I have tried setting the sketch color of a part but I keep getting errors and I'm not sure what I'm doing wrong. I want to be able to have different sketches have different colors, this is in a part document not a drawing document. Everywhere I have looked talks about drawing documents but nothing about part documents.

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 PlanarSketch = CompDef.Sketches.Add(oFace)
oSketch.Color.SetColor(0, 255, 0)

Could someone point me in the right direction