Create Complex Shape Element - argument type mismatch

Hi,

I wrote  short script for longitudinal profile… and I need draw filled half of the circle. Idea is to draw line plus  arc and then create complex shape. part of the code looks like this:

Dim carka As LineElement
Dim oblouk As ArcElement
Dim vrchol(1 To 3) As Point3d
Dim prvky(1 To 2) As ChainableElement
Dim pulkolo As ComplexShapeElement


Set carka = CreateLineElement2(Nothing, vrchol(1), vrchol(3)) 'line
Set oblouk = CreateArcElement3(Nothing, vrchol(3), vrchol(2), vrchol(1)) 'arc
Set prvky(1) = carka
Set prvky(2) = oblouk
Set pulkolo = CreateComplexShapeElement1(prvky, msdFillModeFilled)
ActiveModelReference.AddElement pulkolo
pulkolo.Redraw

When I test it, it worked; but now it doesn't. Debugging window appears with "argument type mismatch" prompt and in "Set pulkolo..." line is marked "prvky" argument. I checked help file, some examples... and I don't know, where can be the mistake.

If I comment last three lines and add these 

ActiveModelReference.AddElement carka
carka.Redraw
ActiveModelReference.AddElement oblouk
oblouk.Redraw

line and arc element appears at the right place - so they are created successfully. 

Does anybody know, what can be wrong?

Thanks,
Stepan