AnsweredAssumed Answered

Multi-Line Sketch Text Vertical Alignment

Question asked by Ryan Sword on May 4, 2012

I'm a recent Inventor convert and up until now, have found answers to all my questions here.


We are trying to "automate" our lamacoid creation a little bit but I am struggling with getting the sketch text vertically aligned automatically based on the number of lines of text.


Here is our situation;


All our lamacoids will have maximum (2) lines of text. We won't always need the 2nd of line text depending on the situation. When we use (1) line of text, I would like the text centered vertically on the lamacoid. When we use two lines of text, I would like the two lines (they are in the same sketch text field) centered vertically.


How I set it up was this;

Custom Properties called Line 1 and Line 2 (this is where we input the lamacoid text)

The sketch text is linked to these two properties.


The problem:

I can only dimension to the bottom of the first line of text which means that there are two possible dimensions, one for single line of text and a different one when two lines of text are present.


What I tried:


I tried to create an equation for d1@sketch2 (which is the dimension driving the vertical position of the text). Logic was if line 2 is not blank, then dimension is 1, if not dimension is 2.


= if ('Line 2' <> "" , 1, 2)


I am using 1 and 2 as examples but that should get the point accross. I have tried many variations of the syntax above but nothing seems to work.


Any Ideas?


As a last resort (and just recent thought), I might end up createing a custom property builder tab where we can enter the Line 1 and 2 text, then have a radio button for mulitline text that would drive the vertical dimension. I would prefer not to do this.


Thanks in advance!