Author Topic: Text Strings Centre  (Read 2363 times)

0 Members and 1 Guest are viewing this topic.

Offline mairomasterTopic starter

  • Contributor
  • Posts: 15
  • Country: gb
Text Strings Centre
« on: March 11, 2016, 10:53:08 am »
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?

Thanks

EDIT: Sorry for the huge screenshot, I didn't realize it will appear so big.
 

Offline exmadscientist

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Technically A Professional
Re: Text Strings Centre
« Reply #1 on: March 12, 2016, 03:29:02 am »
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....  ::) :rant: :palm:
 

Offline mairomasterTopic starter

  • Contributor
  • Posts: 15
  • Country: gb
Re: Text Strings Centre
« Reply #2 on: March 12, 2016, 11:55:35 pm »
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 it :)

The 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/687
https://bugcrunch.live.altium.com/Bug/2176
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf