Learning to create addon

 From:  bemfarmer
10889.10 
BoxMaker

Boxmaker makes a rectangular box with thickened walls and thickened bottom.

This Example is for a box with wall and bottom thickness of 0.2 cm.
(Final version would have user control of dimensions.)

The Box's OD, (outer dimensions), are:
Height: 2cm OD, Width: 4cm OD, Depth: 3cm OD .

For inner dimensions, deduct 0.4cm from Width and 0.4cm from Depth,
and deduct 0.2cm from Height.

The Box sits on the xy plane, centered on the Origin.

1. Create Rectangle, with Rectangle Center command.
In Front View, place the center point at (x,y,z) coordinate
point ( 0, 0, 2 ), which will become top the center of final Box.
In Top View, place the corner point at ( 2, 1.5, 2 ).
This rectangle is at the future top of the box.
The rectangle may be styled black, or some other color.

2. Create Planar surface from the rectangle, and style surface cyan.
This surface will become the bottom of the box after move to z = 0.
Move the surface to z = 0, a coordinate decrease of -2cm.

3. Create a second Planar surface from the rectangle, and style it red.
Later, this surface will become the top edge of the box, and also it will become the interior surface of the box. (Liner)

4. In Front View, Extrude the rectangle down to z = 0, (-2cm).
Do NOT cap ends. Do NOT do Both sides. (Rectangle can be deleted.)

5. In 3D View, select red liner surface, and select MoI command
Offset > Inset. Check checkbox "Use Separate Height", and
set the Height to 1.8cm, Direction Inwards.
This creates the red lining and rim of the box.
Select all 11 faces, and Join to a Solid. (Or select some other automatic way.)

All of these commands can be formed in script, after the user selects the desired dimensions, without further manual selections. Maximum inset height can be calculated. The Views can be replaced with appropriate cPlanes or distances...

- Brian
Hopefully there are not too may minor errors in the above text :-)
Adjustments and changes can be pretty common sense. This is a guide to additional work that could be done...
Extrude tends to make names go away.
Well, I guess that similar procedures could make a heart shaped box also. Or round or oval?
Well, Length could be called Width, and former Width called Depth, or some such terminology...

EDITED: 9 Nov 2022 by BEMFARMER