Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Rich-T
209 Views, 1 Reply

Link Text Height of an Emboss Feature to a parameter

Hi,

I've got a head scratcher.

 

I have an emboss feature with 10 text boxes in the sketch. I want to be able to link the font size of all of the text boxes to a control parameter. I've got the code below but it doesn't work and doesn't seem to update the emboss feature either.

 

Dim oPartDoc As PartDocument
oPartDoc = ThisDoc.Document

Dim oCompDef As ComponentDefinition
oCompDef = oPartDoc.ComponentDefinition

Dim oSketchText As Inventor.TextBox
Dim oSketch As PlanarSketch
Dim oFontSize = text_height / 10

For Each oSketch In oCompDef.Sketches
	For Each oSketchText In oSketch.TextBoxes
		oSketchText.FormattedText = "<StyleOverride FontSize = '" & oFontSize & "'>" & "</StyleOverride>" 
	Next
Next

iLogicVb.UpdateWhenDone = True

 

 

 

Any help would be gratefully received. 

Rich-T
in reply to: Rich-T

Well, I figured out the issue I was having. The text in some of my text boxes contained the "&" character and this throws a problem with the rules from the post linked below.

 

Take out the "&" character and it works fine. Even "@" and "%" and "+" work, but not the useful "&" - go figure.

 

Controlling Textbox size with iLogic. - Autodesk Community - Inventor