Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting the color of a sketchedSymbol

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
bsee1
375 Views, 3 Replies

Setting the color of a sketchedSymbol

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.

*****************************
Win7 x64 - 16gb ram
i7 3610qm
FirePro M4000

Inventor 2013
ETO 6.1
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: bsee1

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)
Message 3 of 4
ekinsb
in reply to: bsee1

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


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 4 of 4
bsee1
in reply to: ekinsb

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

*****************************
Win7 x64 - 16gb ram
i7 3610qm
FirePro M4000

Inventor 2013
ETO 6.1

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report