Wire a finish to the customer's choices — gull system handbook
Three patterns covering colour, texture and material — one choice, an entry carrying two things, or two inputs. And what an empty value means.
Wire a finish to the customer's choices
One rule drives one target. Every case — colour, texture, material, one choice or two — fits one of three patterns.
A part can carry a captured appearance (`appearance@Kryt kol`) and a captured material (`material@Kryt kol`). Each is its own target with its own rule in step 5. One input, though, can drive both rules — which is what the second pattern rests on.
Three patterns, and everything fits one
- One list, one choice. A List input points at a list in the library, and the rule on the target is simply that input's name: `[Barva]`, `[Textura]` or `[Materiál]`. Colour and texture are a rule on the appearance; material is a rule on the material — and with the material the mass and the cut list move too. A colour can also be written straight into the formula: `"#C92A2A"`. A material cannot — see the last section.
- One entry carries two things and the customer picks once. A tinted texture: the texture entry has its optional colour filled in ("Dub, mořený na tmavo"). The rule is still just `[Textura]`, and the customer gets the image tinted with that shade. A material with a colour: the material entry has its colour filled in ("Nerez červená" = AISI 304 + #FF0000). Both rules then point at the same input — `[Povrch]` on the material and `[Povrch]` on the appearance — and the customer picks once. ⚠ A material with a colour has one thing to watch: the appearance rule must point at the input that holds the material. Leave `VZHLED([Textura]; [Barva])` there and the colour comes from the Barva field while the shade stored on the material is never used. Both are legitimate setups — just choose which one you want.
- Two inputs, two choices. Texture and colour independently: two inputs joined in the appearance's formula, `VZHLED([Textura]; [Barva])`. The first argument is always the texture and the second the colour; swap them and gull system refuses and says which. Material and colour independently: two rules and two inputs — `[Materiál]` on the material and `[Barva]` on the appearance. This is the arrangement for painted steel, where one material carries twenty colours.
Texture size and rotation
- `VZHLED` takes two more optional arguments: `VZHLED([Textura]; [Barva]; 80; 45)`.
- The third is the scale in per cent — 100 % is the image's own size, and 25 % shrinks it to a quarter, making the pattern denser.
- The fourth is the rotation in degrees.
- Both can come from an input, so the customer can pick the grain size too: `VZHLED([Textura]; ""; [Velikost vzoru])`.
⚠ Scale and rotation apply to a texture only. They have nothing to act on in a plain colour, so gull system refuses them there rather than dropping them quietly.
Empty means skip
When a colour, texture or material rule produces no value, gull system sends nothing to the CAD. Specifically:
- The rule succeeds — the order is not a failure, and the documents are still written.
- The log shows Not set against it.
- The part keeps whatever it already had.
- It is not a clear. There is no "no material" command, deliberately: it would have to decide what such a part weighs.
An empty value used to be refused as an error so that it would be noticed. In practice that meant every order where a customer left an optional finish blank came out as failed — which is why it changed.
How to make a finish genuinely optional
- Open step 4 and find the input in question — Barva, say.
- Delete its default. While it is there, an empty field in the form means the default, not "no colour".
- Try an order with the field left empty: the log should show Not set and the part should keep the finish it already had.
`VZHLED` is happy with one half. `VZHLED([Textura]; [Barva])` with an empty texture applies the colour alone, and the other way round. Both empty means skip.
Two things to finish with
- You do not have to think about order. The material is always sent to the CAD before the appearance. The other way round, the material would overwrite the colour and the texture — silently, because every command would still report success.
- ⚠ A file path works for a texture only. You can put `\\server\textures\oak.jpg` straight into an Excel cell and the texture is used. For a material you cannot, and that is deliberate: a file's existence can be checked, a material name cannot. A material must therefore be an entry in the library.