Text Strings Centre - Page 1
Forum section: electronics / general

author: mairomaster
author_rank: Contributor
timestamp: March 11, 2016, 10:53:08 am
content: Hello,I am currently doing a general update of all footprints in our company's vault. The idea is to improve them visually and make them consistent.I have the idea to put designators on the the mechanical layer which is used for the assembly drawings (also containing the component outline). For that I will use special strings .Designator, which get replaced with proper designators in an actual PCB.The problem is that I want the designator to be always perfectly centred inside the component outline. However, in Altium a text string has it's reference origin always placed at the bottom left corner. Because of that when the string text gets longer, the text box expands to the right and the actual centre of the box moves to the right as well. Hence, the centre of the string depends on it's current length. To get a better idea, here is a screenshot:You can see that single digit designators look ok, but double, triple etc. are not well centred any more. If the initial .Designator string is placed in such way, that the 3 digit designators will be centred well, then the opposite happens - one digit ones get shifted to the left because they are shorter.The only way I found around this issue was to give the text box a constant size and to justify the text position inside, so that the text always stays centred inside the text box.I am not entirely happy with this though, since the text box should be big enough to hold the entire .Designator text string and since it is always a constant size, it stays as big even after the proper designators are replaced in the PCB. This leaves small components (like 0402, 0201 capacitors for example) with long text boxes sticking outside the component outline. This could be annoying with a busy layout. It increases the mess when you select a bunch of components and also makes it easy to unintentionally select a text box while clicking in the empty space around components.Can you think of a nicer solution?ThanksEDIT: Sorry for the huge screenshot, I didn't realize it will appear so big.

author: exmadscientist
author_rank: Frequent Contributor
timestamp: March 12, 2016, 03:29:02 am
content: You can do this easily using the multi-line string support introduced in AD15 (at least I think that's when it arrived). Dragging the "corner handles" on a placed string object will convert it to "multi-line" type (even if it's only one line) and enable you to set the alignment of the text inside the bounding box.A couple of caveats:This is a new-ish feature, and so requires a relatively recent AD version.It's also kind of buggy. (At least one version would crash when you placed a library component that included multiline text!)If you're using special strings like.Designator, which are typically much longer than the text they represent (e.g., "R1"), you'll have to make the bounding box wide enough to fit the special string. Sometimes this makes things awkward, but it's usually not too much of a pain. Usually.Even with this feature, Altium's text features still lag behind even EAGLE....

author: mairomaster
author_rank: Contributor
timestamp: March 12, 2016, 11:55:35 pm
content: Thanks for the advice, but if you've read my entire post, you would have realized I already considered this and I realize the drawbacks of itThe crashes caused by multi-line strings were fixed in the latest updates of Altium 16 by the way.Apparently, it is not just me who is not happy with this (vote please):https://bugcrunch.live.altium.com/#Idea/687https://bugcrunch.live.altium.com/Bug/2176