You can get into the Basic IDE as follows.
* Open a document -- any kind.
* Tools --> Macros --> Macro...
this brings up the Macro dialog box.

Macros are organized as follows.
Macros can be under a document, or as part of the office and therefore available to any document.
Under either soffice or a document, macros are organized into Libraries. Within a library, macros are organized into Modules. There are two kinds of modules, Basic modules and Dialog modules.

Once you are in the Macro dialog, simply create a new module under the Standard library of your new document. Scroll down, and you'll see your document Untitled1, with a Standard library underneath it. Click on Standard so it is hilighted. Then click the New button to create a module. The New Module dialog appears asking you to name your module. You don't need to name it. Just click OK. Now you're in the Basic IDE.

' Get the usable area of the page.
' The width, for example, would be the page width, but removing the
' left and right margins i.e. BorderLeft and BorderRight.
nUsableWidth = oPage.Width - oPage.BorderLeft - oPage.BorderRight
nUsableHeight = oPage.Height - oPage.BorderTop - oPage.BorderBottom

' Get access to the layers of this draw document.
Dim oLayerManager As Object
oLayerManager = oDrawDoc.getLayerManager()

' Get the number of layers currently on the page.
nNumLayers = oLayerManager.getCount()

' Insert a new layer to hold Ellipse objects.
Dim oCircleLayer As Object
oCircleLayer = oLayerManager.insertNewByIndex( nNumLayers )
' Give the new layer a name.
oCircleLayer.Name = "Circles"
' You can see the circles, but you can't print them as this
' would violate the DMCA.
oCircleLayer.IsVisible = TRUE
oCircleLayer.IsPrintable = FALSE

Dim oShape As Object
Dim oPoint As Object
Dim oSize As Object

' Now make 100 random shapes
For i = 1 To 100
' What is the object's size?
' Let's let the object have a maximum dimension of 4 centimeters,
' and minimum of 0.5 cm.
oSize = MakeSize( RND()*3500+500, RND()*3500+500 )
' The object can be positioned anywhere on the page, but
' must not extend off the usable area of the page.
oPoint = MakePoint( RND()*(nUsableWidth-oSize.Width)+oPage.BorderLeft,_
RND()*(nUsableHeight-oSize.Height)+oPage.BorderTop )

'------------------------------------------------------------
' Create and return a new Point object.
'
' This is syntax sugar to make it easy to
' create a com.sun.star.awt.Point object.
'------------------------------------------------------------
Function MakePoint( x As Long, y As Long ) As com.sun.star.awt.Point
Dim aPoint As New com.sun.star.awt.Point
aPoint.x = x
aPoint.y = y
MakePoint() = aPoint
End Function

'------------------------------------------------------------
' Create and return a new Size object.
'
' This is syntax sugar to make it easy to
' create a com.sun.star.awt.Size object.
'------------------------------------------------------------
Function MakeSize( width As Long, height As Long ) As com.sun.star.awt.Size
Dim aSize As New com.sun.star.awt.Size
aSize.width = width
aSize.height = height
MakeSize() = aSize
End Function

'------------------------------------------------------------
' Create and return a RectangleShape object.
'
' After you create the shape object, you can manipulate
' its properties to alter its appearance, including
' its size and location.
'
' You must pass the document object.
' (Call MakeNewDrawDoc() above to obtain an empty
' draw document.)
' Optionally, you may also pass in a location and size.
' If you do not, then the new object has size (0,0)
' and location (0,0), which is the extreme upper left.
' In other words, the object is squished way up in the
' upper left corner, and has no size, therefore cannot be seen.
'------------------------------------------------------------
Function MakeRectangleShape( oDoc As Object,_
Optional position As com.sun.star.awt.Point,_
Optional size As com.sun.star.awt.Size )
' If IsMissing( position ) Then
' position = MakePoint( 1000, 1000 )
' EndIf
' If IsMissing( size ) Then
' size = MakeSize( 500, 500 )
' EndIf
MakeRectangleShape() = MakeShape( oDoc, "com.sun.star.drawing.RectangleShape", position, size )
End Function

'------------------------------------------------------------
' Create and return a EllipseShape object.
'
' After you create the shape object, you can manipulate
' its properties to alter its appearance, including
' its size and location.
'
' You must pass the document object.
' (Call MakeNewDrawDoc() above to obtain an empty
' draw document.)
' Optionally, you may also pass in a location and size.
' If you do not, then the new object has size (0,0)
' and location (0,0), which is the extreme upper left.
' In other words, the object is squished way up in the
' upper left corner, and has no size, therefore cannot be seen.
'------------------------------------------------------------
Function MakeEllipseShape( oDoc As Object,_
Optional position As com.sun.star.awt.Point,_
Optional size As com.sun.star.awt.Size )
MakeEllipseShape() = MakeShape( oDoc, "com.sun.star.drawing.EllipseShape", position, size )
End Function

'------------------------------------------------------------
' Create and return a TextShape object.
'
' After you create the shape object, you can manipulate
' its properties to alter its appearance, including
' its size and location.
'
' You must pass the document object.
' (Call MakeNewDrawDoc() above to obtain an empty
' draw document.)
' Optionally, you may also pass in a location and size.
' If you do not, then the new object has size (0,0)
' and location (0,0), which is the extreme upper left.
' In other words, the object is squished way up in the
' upper left corner, and has no size, therefore cannot be seen.
'------------------------------------------------------------
Function MakeTextShape( oDoc As Object,_
Optional position As com.sun.star.awt.Point,_
Optional size As com.sun.star.awt.Size )
MakeTextShape() = MakeShape( oDoc, "com.sun.star.drawing.TextShape", position, size )
End Function

'------------------------------------------------------------
' Create and return a LineShape object.
'
' After you create the shape object, you can manipulate
' its properties to alter its appearance, including
' its size and location.
'
' You must pass the document object.
' (Call MakeNewDrawDoc() above to obtain an empty
' draw document.)
' Optionally, you may also pass in a location and size.
' If you do not, then the new object has size (0,0)
' and location (0,0), which is the extreme upper left.
' In other words, the object is squished way up in the
' upper left corner, and has no size, therefore cannot be seen.
'------------------------------------------------------------
Function MakeLineShape( oDoc As Object,_
Optional position As com.sun.star.awt.Point,_
Optional size As com.sun.star.awt.Size )
MakeLineShape() = MakeShape( oDoc, "com.sun.star.drawing.LineShape", position, size )
End Function

'------------------------------------------------------------
' Create and return a Shape object.
'
' You might prefer to call the other MakeXXXShape()
' functions (see above).
' This function creates any kind of shape, but you
' need to know the class name of the shape.
'------------------------------------------------------------
Function MakeShape( oDoc As Object, cShapeClassName As String,_
Optional position As com.sun.star.awt.Point,_
Optional size As com.sun.star.awt.Size )
Dim oShape As Object
oShape = oDoc.createInstance( cShapeClassName )
If Not IsMissing( position ) Then
oShape.Position = position
EndIf
If Not IsMissing( size ) Then
oShape.Size = size
EndIf
MakeShape() = oShape
End Function

'------------------------------------------------------------
' Given a drawing page, find and return a
' names shape on that page.
'------------------------------------------------------------

One annoying thing that yo've got to be careful of. Copying code from OOoForum into the Basic IDE usually introduces spaces at the end of every single line. If any lines end with an underscore _, then you need to make sure that the underscore is the last character of the line without a trailing space. Just one of the hazards of copying and pasting code from OOoForum.

Now click the Run button. See the toolbar at the top of the window? At the extreme left it has a dropdown menu combo box? See a row of buttons to the right of this. The second button from the left is the Run button. Click it. This will produce a new drawing of some shapes._________________Want to make OOo Drawings like the colored flower design to the left?