Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why is Text Size NOT a Parameter???

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
GSE_Dan_A
4591 Views, 19 Replies

Why is Text Size NOT a Parameter???

I have been diving into the world of iParts, iLogic and iLogic Forms and have found them to be very useful! However, I am shocked to see that Text Height is NOT a parameter. The parts I am creating have embossed text.  The size of parts range significantly so the size in text must also change. In making a Form, I would like the Text height to change based on the part being created. (ie if the part thickness is 1.5", I would like the text height to be 1" (Text Height = 66% of Part Thickness).  I was about to create a simple iLogic rule to accomplish this when I noticed that Text Height (from the sketch) is nowhere to be found.  Is there a work around for this?  I have searched the web and some people suggest a macro or VBA (both of which I have never used).


Thank you in advance,

GSE Consultants Inc.
Windsor, ON. Canada
19 REPLIES 19
Message 2 of 20
VdVeek
in reply to: GSE_Dan_A

You can use this iLogic code to change the text height. It overrides the standard Style.

I created a part with a Sketch named "Text" and a parameter named "textToEmboss" that holdes the text i want to extrude/emboss. 

Dim odoc As PartDocument

odoc = ThisApplication.ActiveDocument

 

Dim osketch As Sketch

'The used sketch name in the extrusion is Text

osketch =odoc.ComponentDefinition.Sketches.Item("Text")

 

osketch.TextBoxes.Item(1).FormattedText ="<StyleOverride FontSize='0,5'>"+textToEmboss+"</StyleOverride>"

 

odoc.Update

 

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Tags (2)
Message 3 of 20
GSE_Dan_A
in reply to: VdVeek

Thank you very much Rob!
I will give this iLogic code a go and report back.

GSE Consultants Inc.
Windsor, ON. Canada
Message 4 of 20
GSE_Dan_A
in reply to: GSE_Dan_A

Rob,


What if I want to add a condition to this iLogic? Where would I place this?  For example, if Ring Diameter is 0.50 then the text size will be 0.375. 

GSE Consultants Inc.
Windsor, ON. Canada
Message 5 of 20
VdVeek
in reply to: GSE_Dan_A

I changed the part with the condition (see attachment). You where on the right track when you wrote:  if Ring Diameter is 0.50 then the text size will be 0.375. 

This is the way to write a condition:

 

If parameter Diameter = 0.5 Then

Change the scale of the fontsize: osketch.TextBoxes.Item(1).FormattedText =".............

End If

 

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 6 of 20
blayfield
in reply to: GSE_Dan_A

Quick question... I have a file also that uses ilogic to update the extruded text in a file through a dialogue, I want to be able to control the text character spacing, is there a way I can achieve this?

Message 7 of 20
blair
in reply to: blayfield

The only software I know that allows for "kerning" is publishing software. Most Fonts have Kerning built into the Font. It's just having the correct software to access it. I don't know if you can copy text from something like InDesign into Inventor and retain any Kerning adjustments done in InDesign.

Inventor 2020, In-Cad, Simulation Mechanical

Just insert the picture rather than attaching it as a file
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Delta Tau Chi ΔΤΧ

Message 8 of 20
LT.Rusty
in reply to: blair


@Blair wrote:
The only software I know that allows for "kerning" is publishing software. Most Fonts have Kerning built into the Font. It's just having the correct software to access it. I don't know if you can copy text from something like InDesign into Inventor and retain any Kerning adjustments done in InDesign.

 

 

Unfortunately, copy-pasta of text into Inventor does not retain kerning.  I've tried that.  😛

 

 

This thread actually hits on two of the biggest items on my personal Inventor wish-list: text parameters working in iParts and manual kerning!

Rusty

EESignature

Message 9 of 20
blair
in reply to: LT.Rusty

I didn't think it would as there is nothing in Inventor to hold the changed Kerning. Maybe convert the "Kerned" text to an image and treat it as a Decal

Inventor 2020, In-Cad, Simulation Mechanical

Just insert the picture rather than attaching it as a file
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Delta Tau Chi ΔΤΧ

Message 10 of 20
LT.Rusty
in reply to: blair


@Blair wrote:
I didn't think it would as there is nothing in Inventor to hold the changed Kerning. Maybe convert the "Kerned" text to an image and treat it as a Decal

 

 

... except when you need to mill the text.

Rusty

EESignature

Message 11 of 20
blair
in reply to: LT.Rusty

The only workaround then would be to treat each letter on it's own and set your own "Kerning". Kind of a downer.

Inventor 2020, In-Cad, Simulation Mechanical

Just insert the picture rather than attaching it as a file
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Delta Tau Chi ΔΤΧ

Message 12 of 20
blayfield
in reply to: LT.Rusty

"... except when you need to mill the text"
^^^ This is precisely my issue, I have to machine block after block for mfg. date stamps and the text size is always changing, therefore I need to use different sized endmills to machine this text and desperately need the "kerning" adjustment.
Message 13 of 20
blayfield
in reply to: blair

Unfortunately this would be way too many inputs for my end-users.
Message 14 of 20
LT.Rusty
in reply to: blayfield

One thing that I have done - and I believe that I have Curtis to thank for this one - to manually adjust the kerning if I need to fit a specific size mill between letters is to add additional spaces between letters, but to set the size of the spaces separately from the size of the text.  For instance, if I'm using 3/4" tall letters and I don't have enough clearance, I might add an additional space between the letters, but set the text size for the letters to 1/16 or 1/8 or something.  It gives the letters just that little extra nudge further apart, and really makes milling a lot easier.
The other thing that I've done when milling text - most recently in the example shown below - was to use the MOVE FACE tool, and select everything in the letter and give it a nudge one way or the other.  I'll probably get smacked around for this a little.  🙂    In the below example, the apostrophe-S at the end was just a little too spread out  - there was almost 5/8 of clearance there - so I used MOVE FACE to bring them back closer to the rest of the words.  There are other, better ways to do it: planning ahead would have been the best option. 
 
Capture.JPG
 

Rusty

EESignature

Message 15 of 20
blayfield
in reply to: LT.Rusty

Thanks for the input Rusty, For one-off parts this would be helpful but for my needs I need to be able to control that through ilogic and a form. I have many engineers here that are not inventor literate and are constantly updating these ilogic templates for many part numbers throughout the day and I need them to be able to open it up, be presented with a form, and just type the text that they want changed with a few adjustments, i.e. size, number of lines, depth, logo on-off, etc. If I can acheive this it would be a god-send! I do appreciate your speedy responses. The only way I can think to pull this off is to place letter by letter (we have max characters for part #'s) and have our own font created through sketches. But once again its more input than desired. I will continue the search for an answer and report back if I find something useful. 

Message 16 of 20
guru.srs
in reply to: VdVeek

Rob

How do I call FontSize as a variable?

 

dim ofsize as integer

ofsize = 0.35

'osketch.TextBoxes.Item(1).FormattedText = "<StyleOverride Font='ARIAL' FontSize = '0.35'>" + ocustompropertyset.Item("TEXT" & N).Value + "</StyleOverride>"
osketch.TextBoxes.Item(1).FormattedText = "<StyleOverride Font='ARIAL' FontSize = 'ofsize'>" + ocustompropertyset.Item("TEXT" & N).Value + "</StyleOverride>"

 

With this, instead of changing the font size, it is changing the text to "<StyleOverride Font='ARIAL' FontSize = 'ofsize'>" TEXT

Thanks

Guru Rao

Tags (1)
Message 17 of 20
blair
in reply to: guru.srs

I would think, it's part of the O/S operating system and intergrated as part of the Font itself and that it's never been asked for as well. It's probably something that the programers may have a better handle on how Inventor works with the O/S on items such as a Font-Call.


Inventor 2020, In-Cad, Simulation Mechanical

Just insert the picture rather than attaching it as a file
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Delta Tau Chi ΔΤΧ

Message 18 of 20
BrandonBG
in reply to: blayfield


@blayfield wrote:
"... except when you need to mill the text"
^^^ This is precisely my issue, I have to machine block after block for mfg. date stamps and the text size is always changing, therefore I need to use different sized endmills to machine this text and desperately need the "kerning" adjustment.

 

D

Do you have access to Adobe Illustrator? You can adjust the kerning and tracking of your text, convert to lines, and then export to DXF. BrandonBG
Message 19 of 20
VdVeek
in reply to: guru.srs

@Guru.srs, Thanks to Eelco Wiggers for pointing a way to use a parameter to change the text size.

Take a good look at the way the notation is of the fontsize.

 

oTextBox.FormattedText = "<StyleOverride FontSize=" & "'" & oFontSizeStyleParam.Value & "'>" & sText & "</StyleOverride>"

 Give Kudo's to Eelco here: http://forums.autodesk.com/t5/inventor-customization/set-textstyle-bold-option-is-not-working/m-p/54...

 

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 20 of 20
pmaxwellNKJEX
in reply to: VdVeek

I am also trying to do this, but slightly different, at the moment.

I am making a scalable logo based on the main text height.

I can make follow up extrusions size according to the original text with projections and reference dims.

 

The small thing I want to do is adjust the text height of a sub heading (separate extrusion) based on the main text height.

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

Post to forums  

Autodesk Design & Make Report