mdlPattern_area return -131 MDLERR_CELLNOTFOUND ???

Hi friends,


I am trying to create a Pattern Area with an MDL function and it is not possible for me, it always returns the error -131 (MDLERR_CELLNOTFOUND) and I do not understand why

I'm working with MicroStation v8i (SELECT series 3) v08.11.09.578, with VBA

1. FIRST, I HAVE THE CELL "MYPATTERN" CREATED IN MY LIBRARY OF CELLS

2. THIS IS MY CODE

    DECLARATION OF THE MDL FUNCTION

Declare Function mdlPattern_area Lib "stdmdlbltin.dll" _
    (ByRef patternEdPP As Long, ByVal solid As Long, ByVal holes As Long, _
    ByVal cell As Long, ByVal cellName As String, ByVal roscale As Double, _
    ByVal angle As Double, ByVal rowSpacing As Double, ByVal colSpacing As Double, _
    ByVal view As Integer, ByVal SearchForHoles As Boolean, ByRef originPoint As Point3d) As Long

    IMPLEMENTATION

Const SUCCESS                      As Long = 0
Const MDLERR_CELLNOTFOUND          As Long = -131
Const MDLERR_NONCLOSEDPATELM       As Long = -745
Const MDLERR_NONSOLIDPATELM        As Long = -746
Const MDLERR_INVALIDPATSPACE       As Long = -744

'*****************************************************
'GENERATE A SHAPE ELEMENT
'*****************************************************
Dim points(0 To 4) As Point3d
points(0).X = 440453.86
points(0).Y = 4639314.61
points(0).Z = 297.66
    
points(1).X = points(0).X + 20
points(1).Y = points(0).Y
points(1).Z = 297.66
    
points(2).X = points(0).X + 20
points(2).Y = points(0).Y + 20
points(2).Z = 297.66
    
points(3).X = points(0).X
points(3).Y = points(0).Y + 20
points(3).Z = 297.66
    
points(4).X = points(0).X
points(4).Y = points(0).Y
points(4).Z = 297.66

Dim myShape1 As ShapeElement
Set myShape1 = CreateShapeElement1(Nothing, points)
'*****************************************************

Dim pHatch As Long
Dim status As Long

status = mdlPattern_area(pHatch, myShape1.MdlElementDescrP, 0, 0, "MYPATTERN", 1, 0, 0, 0, 0, False, points(0))

If SUCCESS <> status Then
    Dim msg As String
    Select Case status
    Case MDLERR_CELLNOTFOUND
        msg = "Pattern cell not found"
    Case MDLERR_NONCLOSEDPATELM
        msg = "Element is not closed"
    Case MDLERR_NONSOLIDPATELM
        msg = "Shape element has hole bit set"
    Case MDLERR_INVALIDPATSPACE
        msg = "Invalid pattern spacing and/or cell size"
    End Select
    
    MsgBox msg, vbCritical Or vbOKOnly, "Pattern Grouped Hole"
End If

3. AND RESULT IS ALWAYS    -131

Please, any idea ?

Thanks in advance

Kala