Why does a sketched symbol have a SetColor function even though it doesn't do anything?
For example, this is "legal" code, but it won't do anything.
oSymbol.Color.SetColor(255,0,0);
On the other hand, this is the proper method to set the color of a sketched symbol (I could not find this anywhere in the api)
oSymbol.Color = _mInventorApplication.TransientObjects.CreateColor(255, 0, 0);
Is this an error, or is there a reason for this that I don't see? Intellisense seems to suggest that the setcolor function should be valid.
Solved! Go to Solution.
Solved by ekinsb. Go to Solution.
You first should remove the Color ByLayer check with this before changing the color.
oSymbol.Color.ColorSourceType = kOverrideColorSource
And be sure to use this statement:
oSymbol.Color = _mInventorApplication.TransientObjects.CreateColor(255, 0, 0)
I created a blog post that hopefully answers your question.
http://adndevblog.typepad.com/manufacturing/2013/12/how-to-set-the-color-of-a-sketched-symbol.html
Thank you, that blog post answers everything I was looking for. For anyone else that finds this post, this pdf from AU 2008 gives an in depth explanation of Inventor geometry: http://modthemachine.typepad.com/files/mathgeometry.pdf