Macro: Set transparency of selection

I have a macro in Impress that create a rectangle with given size and position:

Sub Rectangle(xx as Integer, yy as Integer, LL as Integer, HH as Integer)
    '''Insert a RectangleShape to the currently selected slide'''

    Dim oSize As New com.sun.star.awt.Size
    Dim oPosition As New com.sun.star.awt.Point

    oRectangle = ThisComponent.createInstance("com.sun.star.drawing.RectangleShape")
    oPosition.X = xx*100
    oPosition.Y = yy*100
    oSize.Width = LL*100
    oSize.Height = HH*100
    oRectangle.size = oSize
    oRectangle.Position = oPosition
    ThisComponent.CurrentController.CurrentPage.add(oRectangle)

End Sub

Now, when I use this macro, I sometimes want to set the transparency.
So, I tried the following:

Sub test()

call Rectangle(10, 20, 50, 30)
ThisComponent.CurrentSelection.SetTransparence = True

End Sub

Unfortunately, this does not work.
I get an error that the variable of the object is not defined.
Can somebody help me?
Thanks a lot in advance.

In impress, selection always is a group, so, you need access to first index.

selection = ThisComponent.CurrentSelection(0)
selection.FillTransparence = 50

Thank you Mauricio!

Please, check the mark (✓) to the left of the answer that solves your question.