Altium Scripting Adjustdesignator2 - Page 1
Forum section: electronics / general

author: veryevil
author_rank: Unknown
timestamp: March 26, 2019, 06:57:52 pm
content: Hi, I'm trying to sort this it designators on a mechanical layer pair for assembly drawing.I've added the layer pair, a bounding box around my components and a centred text label with the special string .designatorThe issue still stands from 2011 whereby text string cannot be centred and are aligned bottom left. Also it has to be the size of the string .designator meaning it's really big and you end up only having text boxes you can select where ever you click.I found the altium script AdjustDesignators2 which looks very promising. It does a nice job of resizing the test and rotating it all nicely to be 0 or 90 degrees so nothings upside down.What it doesn't do is resize the text box. I believe all the information is there in the script to do it as it calculates the bounding box on the same layer as the text to define the text size. I was hoping someone who is understands the scripting language might be able to modify it slightly to do this?Basically it currently calculates the bounding box, works out the major dimension and scales the font. Then it sets everything and rotates the text box correctly.What I would like is if it also changed the height and width of the text box and then adjusted the X and Y coordinates to be at the bottom corner of the bounding box it found. I think the numbers are there but I just have no experience with the language and the particulars not altium API.Any one have an idea?https://github.com/Altium-Designer-addons/scripts-libraries/

author: ddavidebor
author_rank: Super Contributor
timestamp: April 19, 2019, 01:16:08 pm
content: Hi,You can use draftsman in recent Altium versions to generate assembly drawing almost completely automatically. Bounding box are generated automatically and designators centered.https://www.altium.com/documentation/18.1/display/ADES/((Draftsman))_AD#!Draftsman-BoardAssemblyViewDavide

author: ajb
author_rank: Super Contributor
timestamp: April 19, 2019, 03:46:04 pm
content: Unfortunately with Draftsman you can't generate gerber layers showing the designator, which a lot of assemblers want (and frankly I like having designators on mech layers myself when reviewing the PCB design).The script has Designator.Size and Designator.Width properties being manipulated, and it sort of looks like they SHOULD be getting set to the width of the text, but the Altium API is pretty obtuse.

author: veryevil
author_rank: Unknown
timestamp: April 19, 2019, 06:03:32 pm
content: Yeah it all seems to be there but I just don't know enough to get it working. I also don't currently have time to investigate.

author: ddavidebor
author_rank: Super Contributor
timestamp: April 27, 2019, 11:36:42 am
content: Quote from: ajb on April 19, 2019, 03:46:04 pm.mmh just pdfs.I like to do the review of the layout from the ODB++ files. There is a component layer where you have nets, pad number and designator of every component.A good viewer for that is DFM Now (it's free, less known but actually pretty great)https://www.numericalinnovations.com/pages/dfm-now-free-gerber-viewer