Inventor Engineer-to-Order

Reply
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 1 of 5 (301 Views)

Change text color through <StyleOverride>

301 Views, 4 Replies
02-01-2013 07:57 AM

How can I change text color using <StyleOverride>?

 

Thanks in advance.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 2 of 5 (285 Views)

Re: Change text color through <StyleOverride>

02-04-2013 07:32 AM 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
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 3 of 5 (281 Views)

Re: Change text color through <StyleOverride>

02-04-2013 07:48 AM in reply to: AlexKorzun

Hi,

 

I'm talking about standard design as :IvGeneralNote.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Mentor
FarrenYoung
Posts: 263
Registered: ‎07-13-2009
Message 4 of 5 (274 Views)

Re: Change text color through <StyleOverride>

02-04-2013 09:05 AM 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"
************************************************************************************
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 5 of 5 (269 Views)

Re: Change text color through <StyleOverride>

02-04-2013 09:38 AM in reply to: FarrenYoung

I found best way, I think so.

Just use Style for Note Text.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube