Inventor General Discussion

Inventor General Discussion

Reply
Valued Mentor
GSE_Dan_A
Posts: 303
Registered: ‎10-06-2011
Message 1 of 17 (724 Views)
Accepted Solution

Why is Text Size NOT a Parameter???

724 Views, 16 Replies
03-28-2013 01:17 PM

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

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.

Distinguished Contributor
VdVeek
Posts: 108
Registered: ‎09-13-2012
Message 2 of 17 (690 Views)

Re: Why is Text Size NOT a Parameter???

03-28-2013 11:43 PM 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 2012 Certified Associate & Autodesk Inventor 2012 Certified Professional.
Valued Mentor
GSE_Dan_A
Posts: 303
Registered: ‎10-06-2011
Message 3 of 17 (642 Views)

Re: Why is Text Size NOT a Parameter???

04-02-2013 05:50 AM 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
Valued Mentor
GSE_Dan_A
Posts: 303
Registered: ‎10-06-2011
Message 4 of 17 (636 Views)

Re: Why is Text Size NOT a Parameter???

04-02-2013 06:08 AM 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
Distinguished Contributor
VdVeek
Posts: 108
Registered: ‎09-13-2012
Message 5 of 17 (607 Views)

Re: Why is Text Size NOT a Parameter???

04-02-2013 11:10 AM 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 2012 Certified Associate & Autodesk Inventor 2012 Certified Professional.
Member
blayfield
Posts: 5
Registered: ‎06-06-2012
Message 6 of 17 (343 Views)

Re: Why is Text Size NOT a Parameter???

02-28-2014 01:41 PM 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?

*Expert Elite*
blair
Posts: 4,215
Registered: ‎11-13-2006
Message 7 of 17 (334 Views)

Re: Why is Text Size NOT a Parameter???

02-28-2014 02:32 PM 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.
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

IV2015 SP1 PDSU / Sim Mech 2015 r1 /
Win7-64
EVGA X79 - Classified, iCore7 3930k 32Gb Quad-Channel
950Gb (2 x 500Gb Sata III SSD RAID0 Adaptec 6805E Controller)
Nvidia GTX-690 Classified - 340.52
SpacePilot Pro 3.17.7, 6.17., 4.11
Delta Tau Chi ΔΤΧ
*Expert Elite*
LT.Rusty
Posts: 800
Registered: ‎10-23-2012
Message 8 of 17 (310 Views)

Re: Why is Text Size NOT a Parameter???

03-01-2014 12:51 PM 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.  :smileytongue:

 

 

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


___________________________________________________________

Product Design Suite Ultimate 2013, 2014, 2015

Workstation: i7-4770k / ASUS Z87-Pro / 16GB / 250 GB SSD / 1 TB HDD / 3 TB USB3 HDD / Radeon R9-270X 4GB
Laptop: Toshiba Satellite P755-S5269 (i7-2630QM / 8 GB / 250 GB SSD / 750 GB HDD / GT540M)

*Expert Elite*
blair
Posts: 4,215
Registered: ‎11-13-2006
Message 9 of 17 (305 Views)

Re: Why is Text Size NOT a Parameter???

03-01-2014 01:01 PM 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
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

IV2015 SP1 PDSU / Sim Mech 2015 r1 /
Win7-64
EVGA X79 - Classified, iCore7 3930k 32Gb Quad-Channel
950Gb (2 x 500Gb Sata III SSD RAID0 Adaptec 6805E Controller)
Nvidia GTX-690 Classified - 340.52
SpacePilot Pro 3.17.7, 6.17., 4.11
Delta Tau Chi ΔΤΧ
*Expert Elite*
LT.Rusty
Posts: 800
Registered: ‎10-23-2012
Message 10 of 17 (303 Views)

Re: Why is Text Size NOT a Parameter???

03-01-2014 01:02 PM 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.


___________________________________________________________

Product Design Suite Ultimate 2013, 2014, 2015

Workstation: i7-4770k / ASUS Z87-Pro / 16GB / 250 GB SSD / 1 TB HDD / 3 TB USB3 HDD / Radeon R9-270X 4GB
Laptop: Toshiba Satellite P755-S5269 (i7-2630QM / 8 GB / 250 GB SSD / 750 GB HDD / GT540M)

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.