Can LibreOffice Draw automatically label rectangles with size?

I use LODraw for simple 2-d drafting and would like to solve several problems I have:

  • default text size for labels is too large, 24pt is HUGE
  • individually labeling rectangles with their dimensions is time consuming, especially since I can’t seem to change the default text size in a way that stays default
  • I want the size that shows up in the bottom frame of the drawing window to automatically be the label for a drawn rectangle.

Look for the query and answers of

There could be some hints for you in them. My suggestion was to use the gallery instead of / additional to other ways of proceeding.

Hello @ikratins,

To set the Default font for your Rectangles, do this:

1. Right-click inside your Rectangle and select "Edit Style...",
2. In the dialog that pops up, select the tab called "Font",
3. Set your preferred Font and click "OK".

To automatically insert the dimensions for each Rectangle, you could run the following macro:

Sub SetDrawShapeDimensionLabels()
REM Changes the Text inside all Draw Shapes in the first DrawPage of a Draw document.
REM The new text will display the shape's dimensions as follows: "0.00 x 0.00" ( in Millimeters ).
	Dim oDrawPage As Object, oShape As Object
	Dim strCaption As String, i As Integer
	On Error GoTo Exit_Sub
	oDrawPage = ThisComponent.getDrawPages().getByIndex( 0 )
	For i = 0 To oDrawPage.getCount() - 1
		oShape = oDrawPage.getByIndex( i )
		If oShape.ImplementationName = "SvxShapeText" Then
			strCaption = Format( oShape.Size.Width/100, "0.00" ) & " x " & Format( oShape.Size.Height/100, "0.00" )
			oShape.setString( strCaption )
		End If
	Next
Exit_Sub:
End Sub