Author Topic: Altium Scripting Adjustdesignator2  (Read 2976 times)

0 Members and 1 Guest are viewing this topic.

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Altium Scripting Adjustdesignator2
« on: March 26, 2019, 06:57:52 pm »
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 .designator

The 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/

 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1190
  • Country: gb
    • Smartbox AT
Re: Altium Scripting Adjustdesignator2
« Reply #1 on: April 19, 2019, 01:16:08 pm »
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-BoardAssemblyView

Davide
David - Professional Engineer - Medical Devices and Tablet Computers at Smartbox AT
Side businesses: Altium Industry Expert writer, http://fermium.ltd.uk (Scientific Equiment), http://chinesecleavers.co.uk (Cutlery),
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2721
  • Country: us
Re: Altium Scripting Adjustdesignator2
« Reply #2 on: April 19, 2019, 03:46:04 pm »
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.
 

Offline veryevilTopic starter

  • Supporter
  • ****
  • Posts: 221
  • Country: gb
Re: Altium Scripting Adjustdesignator2
« Reply #3 on: April 19, 2019, 06:03:32 pm »
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.
 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1190
  • Country: gb
    • Smartbox AT
Re: Altium Scripting Adjustdesignator2
« Reply #4 on: April 27, 2019, 11:36:42 am »
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.

.

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
David - Professional Engineer - Medical Devices and Tablet Computers at Smartbox AT
Side businesses: Altium Industry Expert writer, http://fermium.ltd.uk (Scientific Equiment), http://chinesecleavers.co.uk (Cutlery),
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf