| FORUM

FEDEVEL
Platform forum

USE DISCOUNT CODE
EXPERT30
TO SAVE $30 USD

Assembly drawing designator centre

mairomaster , 03-11-2016, 03:32 AM
Hi guys,

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 (the same way it is done on the Rex board and some other boards from Fedevel). 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 I attached 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

robertferanec , 03-12-2016, 12:11 AM
@mairomaster when you find out how to do it, please let me know I also want this!

Maybe, it could be good to add this to Altium Ideas. Please tell them to add an option to orient all the designators with same direction, so they all face only e.g. 0deg or 90deg. I normally do not write to Altium Ideas, as only some get implemented, but who knows, maybe a lot of people will like this one.
mairomaster , 03-12-2016, 10:45 AM
Hi Robert,

I spent almost a day trying to figure out a nice solution to the issue and I also did a good research about the topic.

Unfortunately, I couldn't find such. The closest thing I could find is an Altium script that automates the operation of centring the designators. The script is called Adjust Designators 2:


The latest version found in the git repository is a bit outdated already and doesn't work with Altium 16 (probably 15 as well). I found a modification of it (made by the original author) which works with Altium 16. The modification was posted in a semi-random topic on the Altium Forum and it might be hard to find, so I just attached it here:



I played around with the script for half an hour or so. It has a user interface, but it behaves a bit strangely - you have to play around with the settings to make it do what you want. It doesn't only centre the mechanical layer designators but also rotates them and changes there size depending on the size of the footprint. Apart from the mechanical layer designators, it can also work with the normal silk screen designators (selected from the settings). Generally it does the job, but in the short time I played with it I noticed a few drawbacks:

- It uses a true type font and you can't change that without modifying the script itself (I don't know if such modification is possible and how hard would it be)
- You can only set the minimum and maximum height of the font and you can't really control how it scales up - with some of my footprints the result was not so great (too big font for example)
- It considers the footprint selection rectangle (the one that is highlighted when you select a footprint in the PCB) when determining how much to scale the font size. Many times this works well, since normally the selection rectangle has a size similar to the size of the assembly outline. However, if you have a big text box in the footprint or silk screen or something else that is considerably bigger than the assembly outline, this leads to excessive expansion of the selection rectangle of the footprint (because the selection rectangle should surround all primitives in the footprint). In such cases it might make the designator too big (since it believes the footprint is big). From the options in the interface and comments I read on the web, you should be able to make the script to use the assembly outline for a reference and not the selection rectangle, but I couldn't do it work that way.
- Again because the selection rectangle might not be the best representation of the footprint borders, sometimes the designators end up being not very well centred.

If you try the script, please let me know what is your opinion.

About Altium Ideas, I found that similar suggestions already exist (please vote for them):



robertferanec , 03-14-2016, 03:18 AM
@mairomaster I have not used Altium scripts yet, so it's interesting to know it can be done through it. I will have a look. Thank you.

I had a look at the bugcrunch. I see it's still the same ... you can notice when the ideas were submitted However, I do like the one with Dedicated Assembly drawing layer. That would be very nice to have. I voted for it.
mairomaster , 03-15-2016, 07:10 AM
Hi Robert,

I have been playing around a lot with the script in the past few days and I realized it actually has many bug and half of the interface features are not working properly.

I managed to fix all the bugs (I believe) and I also made some small improvements. I have attached the updated version:

Adjust Designators 2.zip
robertferanec , 03-16-2016, 01:37 PM
Hi @mairomaster Martin has played with the script a little bit today and here are the results (looks good, but still may need to be checked and corrected even after the script):


Script result



Original
mairomaster , 03-16-2016, 02:03 PM
Yes, unfortunately it is not 100% reliable all the time, but in the vast majority of the cases it works well. A review and minor adjustments of the assembly layer after using the script is mandatory, but it should save you a lot of time.
mairomaster , 03-29-2016, 11:36 AM
My update of the script (AdjustDesignators2) was published in the original repository:

Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?