This tutorial discusses a possibility to use a measurement from a drawing as input value for a drawing tool.
Table of Contents
When constructing new entities in CAD, the geometry is usually either based on fixed values entered by the user or on existing geometry. For example, when creating a parallel line with a given distance to an existing line, the distance is entered as a fixed value while the base line is clicked with the mouse.
There are situations when a measurement is present in a drawing but not in such a way that the tools of QCAD can be used to directly base a new entity on it. In these cases, a measurement may be extracted from the drawing and used as input for the current drawing tool. You can for example use the radius of a circle as input for the length of a line. This allows for a workflow that does not require you to write down or copy a measured distance and instead let QCAD store and reuse the measurement.
In this example drawing, we want to draw the missing edge in the top view.
We can easily do this using the offset tool once we know the offset distance (which is not a known fixed value).
The distance for the offset tool is visible in the front view of the part shown at the top (length of the red line d):
There are various ways to reuse this measurement. One possibility would be to use a measuring tool and remember, write down or copy the measured distance. Another way would involve an auxiliary construction to project the top edge down into the top view, so the offset tool Offset (through Point) can be used to create the offset.
For this example, we use an alternative technique: we start the offset tool and instead of entering a value for the distance, we tell QCAD to use a distance measured from the drawing.
- Start the offset tool:
Modify > Offset (with Distance)
- The options toolbar of the offset tool is shown at the top with the last used value displayed for the offset distance (here "1"):
- Clear the distance field and right-click into the input field. A context menu is shown. Choose the entry Insert Measurement and then Distance Point to Point:
- The measuring tool for measuring distances between points is started. Note that the offset tool stays active but waits for the measuring tool to finish.
Click the first point to measure the distance (at the right of the red distance line):
- Click the second point (at the left of the red distance line):
- QCAD now inserts the text "d1" into the input field of the offset tool. A tooltip with the measured distance is also shown for a short while for your reference:
d1 is a variable (or placeholder) that refers to the exact measured distance. You can treat this variable just like the actual measured value.
- The offset tool can now be used with this distance to create the offset at the measured distance:
The variable d1 in the above example can be reused for any other value inputs in any other drawing tool while working on the same drawing during the same session of QCAD. The measured variable can also be used in the property editor and in the command line of QCAD, for example when entering coordinates. Variables may also be used in mathematical expressions, for example "d1/2" to use half the measured distance.