Pattern throws an error

After extensive work on a pattern I closed it and went to bed. (yesterday) Today I first updated to 2024.11.11.202 (Win 11) Then opened said file to finish it, but opening it throws an error. line 451 column 17 On this line stands: groups (with signs that go missing when message is posted) I then tried nearly all my other files and none had the same error, so presumably it wasn’t the update that caused it. Attached file for perusal. 1775 coat.sm2d (57.9 KB)

2 Likes

Hello, @DraftCraft

For some reason your pattern doesn’t like the provision for groups, so I’ve deleted it and now your pattern works.

1775 coat - a.sm2d (57.9 KB)

Perhaps @Douglas or @Pneumarian should have a look because I have no idea why.

1 Like

Thank you very much Grace. I did try erasing that line, but it returned after reopening. Your version however does work, curious what I might have done differently. But thanks for the quick response

2 Likes

It will return because it’s the provision for if you wish to add groups. I’d suggest that you create a group with anything in it. Perhaps that will permanently fix the problem.

However I do suggest that @douglas have a look. It may be a bug that’s snuck into the software.

Since files without images have <groups/> between </pieces> & </draftBlock> I tried moving <groups/> to between </pieces> & <images> instead of between </images> & </draftBlock>, & that seems to have worked as well, so I wonder if this is related to @Onetchou’s work.

:unicorn:

1 Like

That seems to be the issue… And I know what it is. When a new pattern is created all the (empty) element tags for a draftblock are created to establish the order of the tags. Except - the TagGroups was not included… which before adding the images was not a problem as the TagGroups was just appended whenever a Group was created. But now with the TagImages - which also just gets appended, means if you load an image first, then create a group the order gets mixed up and when the file is parsed it throws a file excpetion.

It’s a side effect of who ever added the groups feature - they didn’t have the basepoint tool create the TagGroups… and subsequently the tagTagDraftImages. It’s simple fix. Already done.

3 Likes

@DraftCraft

Moving the < groups > before the < images > will fix the problem… in this pattern. Until I make a PR for the fix, the way to avoid the issue for now with any new pattern draft blocks is to create at least 1 group first before loading any images.

2 Likes

Thank you very much, @Douglas & @Pneumarian

1 Like

I just made a build and created a new pattern to check… it’s now writing an empty draft block correctly. :slight_smile:

<draftBlock name="Draft block 1">
    <calculation>
        <point id="1" mx="0.0520833" my="0.104167" name="A" showPointName="true" type="single" x="0.3125" y="0.416667"/>
    </calculation>
    <modeling/>
    <pieces/>
    <groups/>
    <images/>
</draftBlock>
3 Likes

The PR for this issue was just merged, and should appear in this weekend’s build.

2 Likes