Skip to content

Module form

The module form is the set of questions that whoever uses the module in a project will answer — “Width”, “How many doors?”, “With plinth?”. Each answer feeds a variable, and the module’s formulas do the rest. The designer never sees variables, expressions or parameters: they only see a Configure module name window with simple questions.

How it works

  • A form field is a variable marked as a form question. It has a readable label, optional help text and a control type.
  • A field’s value is always a plain number — it is the question’s default value. A field can’t depend on other variables.
  • Internal variables use the fields by name, like any other variable: door_width = width / door_count.
  • Only the fields appear in the form. Every other variable stays internal.

Opening the form builder

  • ModuleCAD brand menu → Edit module form…; or
  • When you save a version for the first time, answer Yes, build the form to the question “Does this module need a configuration form?”; or
  • In the Version history, use Edit next to the form summary.

The builder opens almost full screen, titled Module form — name, with three columns: Fields, Internal variables and Customer preview.

Adding fields

There are two ways:

Click Promote variable and choose a variable that already drives the geometry. It becomes a field, and its current value becomes the default.

Only variables with a constant value can be promoted. A variable whose value is an expression appears locked (“References X — give it a constant value first”).

New input

Click New input, enter the Identifier (the variable name) and the Default value and click Create. Then use the field in an expression — for example, width = bay_count * 450 — so the answer affects the geometry.

Configuring each field

Each field is a card that can be reordered by dragging. Options:

Option Description
Label The text the customer reads (“Cabinet width”). Required.
Identifier The variable’s name. Read-only here.
Help text One short line shown under the label (optional).
Control Number, Choices or Yes / no (see below).
Used by The list of variables and bindings that use the field.

Remove from form turns the field back into an internal variable.

Control types

Control The customer sees Settings Value
Number A number field Default, Min, Max, Step and Unit (the label shown, e.g. mm). The number typed.
Choices A drop-down list A list of options, each with a label (what the customer reads) and a value (the number). Default choice. The chosen option’s value.
Yes / no A switch Default On or Off. 1 (on) or 0 (off).

An example Choices field for doors:

Label Value
No doors 0
One door 1
Two doors 2

And an internal variable that uses the choice: door_width = if(door_count == 2, span / 2, span).

Internal variables

The middle column lists the internal variables with their expressions, editable right there — the place to “wire” a new field into a formula. Full variable editing stays in the Parametric tab.

Customer preview

The right-hand column shows the form exactly as the designer will see it, working. Change the answers to check the variables’ Resolved values. Reset to defaults returns to the initial answers.

Validation on save

When you click Save form, the builder checks that:

  • every field has a label;
  • min is not greater than max;
  • the default is a plain number and lies within min/max;
  • no two options share the same value.

Problems appear under “Fix before saving:”. Fields that nothing uses raise a warning (“Nothing references X — these answers won’t change the module”); you can wire them into an expression or click Save anyway.

The form decision

Every module records a decision about the form, asked only once, the first time you save a version:

Decision In projects
Yes, build the form The designer fills in the form when adding the module and can change the answers later.
No — fixed module The module arrives exactly as it was built: “This module comes ready to use”.
(undecided — older modules) The panel shows the raw list of numeric variables.

Once decided, the question isn’t asked again. The version history shows a summary (“Form: 5 fields — Edit” or “No customer form — Change”). Deleting the last field of a module with a form returns the decision to “undecided”, and the question is asked again at the next version save.

What the form doesn’t do yet

  • Group fields into sections;
  • Show or hide fields depending on other answers;
  • Images in the choices;
  • Expose material variables.

See also