How to Make Ribbons and Toolbars for BricsCAD and AutoCAD

A collection of notes... Say your menu is MenuName

General points to consider

Challenges

The way Autodesk introduced trusted paths is at the least to say clumsy because it shut down a lot ways to create applications, ranging from that nice little LISP routine to large applications. On the other hand, security is important and concerns about running malicious code are justified. Bricsys luckily did not follow this path so far but one day they have to answer to the question how to better protect against malicious code execution. Educating users not to download and use code from other sources than trusted ones, like hired and screened coders and evaluated and registered apps from the app store, is not only the least thing to do but also the most important first step. After that, what is left of the risks? Depending on the answer, execution of code could be limited to code in the "program Files" environment. But that should not break things like loading MenuName.cui from the "application data" environment and refuse to run MenuName.mnl. This is an interesting topic and time will tell where we end up with. For now, the most important thing is to design menu's with an as much as possible shared base between BricsCAD and AutoCAD. It was for us the reason to create a cross CAD platform autoloader, see ACME.

Some comments on menu conversions

A while ago, .mnu files were the only way to define menu's. Defining them in XML was a logical step, but it took away - or at least limited - the possibility to use a text editor like notepad++ to maintain menu's. Custom User Interface files, .cui, files were introduced. These XML files could be created from .mnu files and this is possible up to today in both CAD programs. Conversion is lossless. At NedCAD we keep our source menu's, consisting of many hundred lines, in .mnu format because translation to .cui is seemless. We don't use the command CUI for editing .cui files.

When ribbons were introduced, there was a good reason not to use them and to neglect them: They are for starting CAD users and they eat up your priceless monitor space. But some users wanted them so we used CUI to make it and created a file for that:

<RibbonRoot>
All definitions
</RibbonRoot>

This way we can still use our .mnu files as a base and inject the RibbonRoot part later.

For BricsCAD, thumbnails for buttons can be placed in a container by zipping them to a file and then renaming the file to MyMenu.resz. No compression, just storing is preferred.

Autodesk introduced .cuix files at some moment. These zipped files contain everything, including button thumbnails. AutoCAD sees them if you put them in the same folder as the .cuix file. You can feed AutoCAD the BricsCAD .cui file in order to make a .cuix menu.In fact, AutoCAD finds these .cui's and translates them automatically. Unfortunately, there are often problems with fly-outs that are ignored. So the best way to create a .cuix file is to feed a .mnu file at CUILOAD.

For BricsCAD to make a .cui file, it can read an AutoCAD .cuix file. Unfortunately, the bloat AutoCAD xml tags from the .cuix are imported to the .cui file. So when choosing a menu to load in BricsCAD with CUILOAD, always choose .cui, not cuix.

Sometimes these xml files get a bit messed up. Don't hesitate to start XML copy editor end press F11 for "pretty printing". Look what is wrong with Notepad++ or XML copy editor and fix it.

How to Make Ribbons and Toolbars for BricsCAD and AutoCAD (laatst bewerkt op 2017-10-05 21:37:17 door WiebeVanDerWorp)