Hi, and welcome to the QCAD forum.
Using QCAD Pro in GUI mode that is made easy.
Select the magenta Polyline and change its
size 2 property to 18 in the Property Editor.
The focal point is the center of the 'rectangle', meaning that it grows 1 unit up and 1 unit down in this case.
If that is not the intention, you must specify and account for in which direction the 'rectangle' should grow.
An OS command line script to do this action on data in a DXF is less easy.
The Polyline does indeed represent a rectangular shape but seen from DXF perceptive it is nothing more than line-art with a closed nature.
There is nothing like a named object type for
Simple quadrilaterals, nor for complex or any other shape than Circles or Ellipses.
At best it can be called a 'Polygon'.
A Polyline is representing a rectangular shape when:
- There are 4 line segments. => All bulge factors are zero.
- Every 2 consecutive segments form a 90 degree angle.
- It is logically closed and has 4 distinct vertices.
OR
- It is not logically closed, has 4 distinct vertices and a fifth that coincides with the first what makes it geometrically closed.
size 1 is always the largest reported size of the two.
It is the base angle that adapts.
Note that the QCAD GUI even allows for a 'rectangle' with rounded corners what has at least 8 vertices and 4 bulging segments.
And that may rather resemble a circle with for example:
size 1 =
size 2 = 20 and
Radius = 10.
Then the
Base Angle is always reported as zero or 90° even when rotated otherwise.

(
A zero-length line has no well defined orientation)
Further, these are undocumented Pro features.
The
RPolylineData Class Reference doesn't list:
- RPolylineData.getBaseAngle()
RPolylineData.getWidth()
RPolylineData.getHeight()
RPolylineData.setWidth(value)
RPolylineData.setHeight(value)
Unsure but these functions will probably work when
polylineProxy is availible.
Not knowing when it is considered a 'rectangle' and how to test for it.
Perhaps the getters simply return '
undefined' when not a 'rectangle'.
The basics for writing an OS Command Line script can be found is this
tutorial.
Line 66-69 is the simplistic action of this example and must be replaced by dedicated code.
That should look if a given Layer exists, query the entities of that Layer, filter on Polylines, filter on rectangles 16 high and adapt their height.
Importing (Off-screen) and exporting the file back is handled.
Regards,
CVH