Change sketch line color

Change sketch line color

Anonymous
Not applicable
3,001 Views
4 Replies
Message 1 of 5

Change sketch line color

Anonymous
Not applicable

Clipboard04.jpg

Is it possible to change the line color in a planar sketch using ilogic as shown in the picture? Here is the code i have so far:

 

Dim osketch As PlanarSketch
osketch = ThisApplication.ActiveEditObject
For Each oentity In osketch.SketchLines

oentity.Layer.color.SetColor(100,100,100)
			
Next

 

Also how and in when do you use this command?

ThisApplication.CommandManager.ControlDefinitions.Item("SketchLineColorProperty").Execute2 (True)

 

0 Likes
Accepted solutions (1)
3,002 Views
4 Replies
Replies (4)
Message 2 of 5

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous 

 

See if this recent thread helps:

https://forums.autodesk.com/t5/inventor-customization/having-trouble-setting-sketch-color-in-a-part/m-p/9284119#M105166

 

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

EESignature

0 Likes
Message 3 of 5

Anonymous
Not applicable

No. This only changes the sketch color not the exact sketchline color......

0 Likes
Message 4 of 5

JelteDeJong
Mentor
Mentor
Accepted solution

does this help?

Dim red As Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
Dim osketch As PlanarSketch = ThisApplication.ActiveEditObject

For Each oentity As SketchLine In osketch.SketchLines

    oentity.OverrideColor = red

Next

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 5

Anonymous
Not applicable

Yes! This is exactly what i was looking for....:)

0 Likes