Hi Martin,
Looking at your code, it is simpler and more elegant than mine, and mine only seems to work on the trackpad (so far).
@Steve_Cornford
Hi Steve,
My code inserts the chair labels at the template-building stage, which means there is a separate entry put in the marks list for each label.
Your code is creating the labels at the drawing stage from the existing marks list data for the chair outlines.
There are pros and cons to both. Your code is needed to be replicated in up to 9 separate places:
on the control template screen
on the background templates screen
on the paper print output for the control template
on the paper print output for the background templates
on the PDF output for the control template
on the PDF output for the background templates
on the 2D DXF exports
also perhaps on the image exports / sketchboard if we get it going in T5
and maybe also on the drawings in the storage box, although the labels wouldn't serve much purpose there.
That's not as bad as it seems -- mostly copying and pasting -- with the advantage that each one can be modified for colours, font sizes, etc. to suit each location.
My code goes to all those automatically because it is coded 99 as a timber number. So it will be the same size, font, colour, etc. as the timber numbers, and won't appear in places where the numbers don't. For example if the timber numbers layer combo is switched off in the DXF.
The better solution than either of those is to invent a new code number for the chair labels, and create a suitable representation just for them in each place. This also has the advantage that they can be made clickable. But that's a lot more work -- which is why I hadn't got round to it yet.
In fact, mine are clickable if the timber shoving is active, and it messes up the timber shoving:
Which one shall we push to GitHub for now, and come back to later?
I note on your printed version there is no label for the AA chair. Also on timber X3-X there is an XN label, but on your trackpad it is ZY.
As far as the prefix is concerned could you parse the label text deleting all characters up to & including the period (fullstop or . to us mortals)?
They are not the same size template, hence the XN instead of ZY. But where the AA label went is a puzzle.
Removing the template ID prefix that way won't work because it would remove it from the timber numbers too. There is no intelligence at that stage to differentiate chair labels from timber numbers. They are all code 99. But maybe the template ID isn't needed in such situations? It would be more logical to identify the brick rather than the template. So much still to think about, but hopefully it can wait until T5 is up and running. That is beginning to feel more urgent for some reason.
Also I have a query regarding the labels for the CCL/R and CCR/L chairs.
Should the ones at the switch end of the check rails both be CCL/R?
And conversely should the ones at the opposite ends of the check rail both be CCR/L?
That foxed me for a moment too. Perhaps I need to change the designations to avoid confusing everyone. CCL/R means CC-FLARE-IN and CCR/L means CC-FLARE-OUT (for running in the facing direction on either road). These chairs a very complex because of the option to adjust the flare lengths and end gap individually on each check rail.
Perhaps they could be called CC-ML/TR and CC-MR/TL for MS and TS roads.
Thanks again.
cheers,
Martin.