scripts-libraries icon indicating copy to clipboard operation
scripts-libraries copied to clipboard

AssemblyTextPrep not working with a single sided board

Open justinmassiot opened this issue 1 year ago • 0 comments

Hello @RnDMonkey ,

I'm currently testing your script 'AssemblyTextPrep' on one of our projects but I think I've found a little bug in it.

The test is on a board with components on Top layer only. The PCB is already populated with ".Designator" texts on Mech layer 25 because, in my setup, M25/M26 is the pair used to put RefDes (function "Designator"). image

At starts, the script pops an error: "Couldn''t determine top assembly layers from existing components or mech layer pairs:".

After a quick look into the code, it looks like the MLP.PairDefined(ASSY_LAYER_BOT, MLS.GetMechanicalLayer(i).LayerID) function doesn't do what we expect from it:

  1. 'ASSY_LAYER_TOP' is correctly set
  2. The script looks for a corresponding 'ASSY_LAYER_BOT'
  3. But it doesn't find any (ASSY_LAYER_BOT := MLS.GetMechanicalLayer(i).LayerID; is never reached)
  4. And ends with an error

I wonder how it's even possible! Do you have any idea to fix this?

As soon as I put a component on the Bottom side, the script starts correctly.

--

Side note: the name of the Mech layers are reported incorrectly: image

In my case it should have been "Mechanical Layer 25", instead of "Inner Layer 24".

justinmassiot avatar Oct 30 '24 16:10 justinmassiot