Hello,
Using iLogic, this can be achieved.
- Lets say the board is 100mm high, and you want the text to always be half the size of that (50mm), create two custom parameters:
- One parameter should be "BoardHeight" and should be set as 100mm, in this example.
- The second parameter should be called "TextSize" and should be set as BoardHeight/2
- Now in your model, go to sketch that defines the board height and change the dimension to be BoardHeight
- Now go to the manage tab and select "Add Rule" from the iLogic pane.
- Paste this code in. Where it says "Sketch2", change it to the sketch that contains your text
SyntaxEditor Code Snippet
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("Sketch2")
osketch.TextBoxes.Item(1).FormattedText ="<StyleOverride FontSize='" & TextSize/10 & "'>" & oSketch.TextBoxes(1).Text & "</StyleOverride>"
odoc.Update
Now whenever the BoardHeight parameter is altered, the text size will change accordingly.
If you want the text size to be defined differently, for example the board height - 20mm, then change the "TextSize" parameter to be BoardHeight-20mm instead.
If you need any more help with this let me know 🙂
Lewis Young
Windows 7 x64 - 32GB Ram
Intel Xeon E5-1620 v2 @ 3.70GHz
nVidia Quadro M2000 - 4GB
Inventor Professional 2017.3
Vault Basic 2017