OpenSite/Reference/Commands/Set a quantity
Change one quantity through opensite.document.set_quantity, recompute, and save.
- Stable identifier
cli.document.set
Implementation milestone
Roadmap phase 1 (historical Phase 1).
Units
The command interprets --value in --unit and stores the canonical SI quantity. The unit id must already be registered.
Terminal example
Python access
examples/python/document_edit.py calls document.set_quantity with a QuantityArgument built from parse_quantity('250 mm').
Output
Stdout is the inspected document after the save. Width 0.25 m and height 0.60 m give area 0.15 m².
Errors
A --value or --object that does not consume the whole argument exits 2 and reports that an argument is not a valid number. That includes a trailing suffix, a negative or out-of-range object id, and a non-finite quantity such as inf or nan. Decimal and scientific forms such as 4e-1 are accepted. The decimal mark is .. The check does not use the machine locale. Exit 2 does not modify the file. A missing required flag exits 2. A rejected edit exits 1 with the status message. An allocation or execution failure exits 1 with its own message.
Limitations
If the file has exactly one object, --object may be omitted. An object id is an integer from 1 through 9007199254740991. Derived properties cannot be edited. This does not switch the unit-preference profile.
Verification evidence
Repository evidence references (not rerun for this publication): CTest cli.document, including --value abc, 0.25m, inf, a negative object id, an oversized object id, an unchanged file after those rejections, and --value 4e-1.
Try this workflow
Quantities and profiles — a worked lesson with expected results.
Documentation basis
Source-reviewed against development commit 77c3fee13944bcc4b5d487c77eb1f82fbe4c6ea7, branch feature/phase-13c-properties-python-expressions. This review inspected the implementation and repository evidence; it did not run the Windows application or repeat CTest.
src/cli/main.cppsrc/cli/document_commands.cppsrc/cli/preference_commands.cppsrc/application/builtins.cpp