Done with updating New Pattern and draft block. Just waiting for my last PR to be merged so I can pull the Develop branch changes into this branch… it’s easier to resolve any conflicts locally.
So, besides the previous addition of being able to name the pattern and add a measurement file when Selecting “New” pattern, you will now be able to a default point name prefix… with a few limitations. One of those limitations is when adding a New Draft Block you can not use a current base point name of an existing draft block. Basically we need to preserve the uniqueness of the basepoint name. Adding a new draft block is actually adding a basepoint tool. When editing a draft block you are free to use or rename the prefix to an existing basepoint.
The draft block toolbar has been updated:
An Edit button has been added for the current draft block… followed by the usual draft block drop down box - which I renamed Name:. Next to that is a new Prefix edit box, where you can rename the prefix for the current draft block. Lastly is a “Reset” button, which will reset the prefix to the basepoint name. So you are now free to automatically name points at will and not be tied to the A, B, C, D… etc of the basepoint name convention. You could do something like below naming the “Front” block points FR1, FR2… then switch to something like Notch to add your notch points, then switch to Anchor to add your anchor (pin) points. Or for those that are drafting a front, back, sleeve, and collar all in 1 block… you could change your prefix as you you work on the different parts… such as F, B, S, and C… or whatever.
The New and Edit dialogs handle any errors in the name or prefix - such as an empty field, an existing block name or base name or a prefix that does not fit the reg expression’s allowed or basically what format and chars are allowed.
Gone is the additional message box that pops up saying “That name already exists…”. Like you should be used to see by now in other dialogs the text in the edit box will turn red indicating the current name / prefix is unacceptable. Such as blank fields or illegal prefix name:
Note the prefix “Reset” button is also in the Edit dialog.
When adding new blocks the default prefix name will still follow the A, B, C, D… (in the label language) that currently exists.
There is now also a “Delete Draft Block” item in the Tools menu, which will correctly delete the current draft block. Since I changed the whole naming scheme to use the prefix, there is no mix up in syncing new point names to the basepoint name - which may have been deleted.
For those interested in the nuts and bolts… the < draw > block now has a prefix attribute, but also maintains the basepoint name. No conversion for older patterns is required… I simply used the basepoint name as a default name for the prefix attribute if it’s missing (which in previous pattern versions it will be) when parsing the file. So now you will see something like this in the XML:
About the only thing I can think of to add to this would be to improve the Prefix as far as illegal chars are entered - currently it just reverts back to the existing prefix. Also I thought of maybe changing the prefix line edit box to an editable dropdown, where you could add your own custom prefix names, and then you could just select a prefix from the drop down.