The new MTF Snippets functionality in 12d Model allows for the creation of dynamic, intelligent and reusable objects that can be quickly and easily used in your design projects. Those writing, or even viewing, MTF snippets often do so in a text editor. To make it easier and clearer for snippet authors (aka snippeteers), I have created a User Defined Language (UDL) file for the excellent and highly-recommended Notepad++ text editor. This provides MTF Snippets syntax highlighting for any MTF Snippet files (file extension .mtfsnippet).

Features
At the moment, the MTF Snippets syntax highlighting supports the following features:
- Line and block comments
- PARAMETER, DISPLAY and INFO special definitions
- V10 C-preprocessor directives, e.g. #define, #ifdef
- New V11 snippet preprocessor directives, e.g. @ def_tok , @ if_tok
- Parameter and token substitution as $VAL and $(VAL)
- Snippet-specific commands- variable, link_variable, user_message*
- Snippet helper functions and mathematical functions, e.g. sin, rel_offset
- Most, if not all, MTF Modifier commands, e.g. insert, remove, named_grade
- Most, if not all, of the MTF Modifier keywords, e.g. absolute, extra_start, unknown
I will add features as they are added to 12d Model. The file is current for V11 C1h.
Instructions
- Download the 12d MTF Snippets language file from the links below.
- Open Notepad++
- Select from the main menu
- From the panel that appears, click the Import button
- Browse for and select the file you downloaded
- If the import is successful, it should pop-up a dialog saying so.
- Close and restart Notepad++
- Any file with a .mtfsnippet extension should automatically use the new MTF Snippets syntax highlighting.
- Otherwise, to manually use the MTF Snippets syntax highlighting, select the menu item (near the bottom)
You can change the colours, fonts and styling used for the different categories and keywords by opening the
panel in Notepad++ and clicking on the Styler buttons for the various sections.Screenshots for instructions:
If you have any problems, feedback or requests, leave a comment below.
I followed the instructions for the 2nd time to update things.
i got 2 copies of the mtfsnippet language and it wasnt clear which one I was using (the old one)
Appears from my 2nd install of this that you need to delete one or both of the languages, restart notepad++ and then follow the instructions again. Even then I had to do step 9
Ah, yes, sorry. I didn’t update the instructions. Thanks for that, Ed.
I believe Step 9 should only be required the 1st time it’s done. I think Notepad++ needs to be restarted (exit then start again) to pick up the automatic syntax highlighting.
I’ll try to update the instructions to reflect this.
It appears to me that you have updated to include decision_xxxxx in the keywords 🙂 (I dont think it was there before)
The reason I raised the update request was that I thought *decision_label* and *decision_goto* type commands should have an extra-obvious, eye catching highlighting. To my amateur programming mind, these are perhaps more significant place markers.
But big ups to you for making these kinds of things available for mere plebs. Thanks
Yes, a kind person (Mr. Gunter) gave me a list of all MTF keywords, so all the MTF stuff should now be in there.
Code folding should also work for all the @ if / @ else / @ end_if stuff. I think I forgot the decision_then/decision_end stuff, though.
For code folding, you can also use the special comments //<< and //>> to create custom regions. See the bottom of the updated screenshot above.
Also, when I next feel so inclined, I’ll probably whip up a similar syntax highlighting file for just MTFs. That should allow for different colouring/styling of different sets of keywords not possible with the MTF Snippets stuff. For example, all the Fixed>Decisions commands could be a different style to the Fixed>Insert stuff. I just need to find some time and logically group the commands.
Matt,
I have a alternative Dark Themed variation of your syntax highlighting if you want it. I also have one for boxing (dark themed also).
Let me know if you want to add them to the above?
Cheers,
Seb.
Seb,
Yeah, happy to host them here if you want. If you can email them through to mattmonk at {this website} dot com, I’ll put them up for everyone.
Thanks.