Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change text color through <StyleOverride>

4 REPLIES 4
Reply
Message 1 of 5
Lesoux
1592 Views, 4 Replies

Change text color through <StyleOverride>

How can I change text color using <StyleOverride>?

 

Thanks in advance.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
4 REPLIES 4
Message 2 of 5
AlexKorzun
in reply to: Lesoux

Hi,

 

You did not mention the type of the Inventor object you wanted to apply the Color to.

 

If the object is under Intent control, try the following:

1. Call GetHostObject()  to step from Intent Part to Inventor object

2. Use the .Color setter on that object.

 

 

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 3 of 5
Lesoux
in reply to: AlexKorzun

Hi,

 

I'm talking about standard design as :IvGeneralNote.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373
Message 4 of 5
FarrenYoung
in reply to: Lesoux

I don't believe this is possible via StyleOverride

Looking at the Inventor API help there is a list of the options that are available via StyleOverride

mk:@MSITStore:C:\Users\farren.young\Desktop\Inventor%202013%20API.chm::/HTML/FormattedTextTags_Overview.htm

 

Style Override <StyleOverride>

 

The StyleOverride tag defines all text style information. The various style options are defined within the tag using attributes. These attributes are described below.

 

Font – Sets which font to use. The input to this attribute is the name of the font.

FontSize – Sets the size of the font. The input to this attribute is the size in centimeters.

Bold – Allows you to turn bolding on or off. The input to this attribute is the String "True" or "False".

Italic – Allows you to turn italics on or off. The input to this attribute is the String "True" or "False".

Underline – Allows you to turn underlining on or off. The input to this attribute is the String "True" or "False".

 

As Alex mentioned, you will need to override the color property of your object.

To get the color you have to create it using the inventor application transientobjects class.

gethostobject(me).set_color(%%inventorapplication.transientobjects.createcolor(0, 255, 0)) 'RGB value

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 5 of 5
Lesoux
in reply to: FarrenYoung

I found best way, I think so.

Just use Style for Note Text.

Win10 x64
Xeon E5-1630
32 Gb RAM
Quadro K5200

Inventor 2020.3.4, Build 373

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

Post to forums  

Autodesk Design & Make Report