Creation of SPT bedding in loop using SPTS

Hi All,
I’ve come across a little problem trying to assign bedding properties to my structural points (generated through a loop) using SPTS command.

Here is the code:
IF #PP==2
LET#NX (5050+100*#NRP1)
LET#DX (#OF1-#OPP1)

SPT NO X Y Z
5150 #DX 0 #H1
(5250 #NX 100) ((#DX-#RP1) -#RP1) 0 #H1

SPTS (5150 #NX 100) CP 10000 CQ 5000

ENDIF

I’ve tried to find a way around but right now I cannot come up with anything.
The SPTS only put spring on the last record of generated SPT.

In this case #NRP1=3 so I generated 3 points: 5150, 5250, 5350 but as I mentioned before - the spts only works for the last generated point - 5350.
Is it even possible to do it with SPTS command?

Thanks for your help.
Szymon

SPTS generates a spring at the last defined SPT.
I doubt table generation works, so you’ll have to loop.

This should work:

IF #PP==2
LET#NX (5050+100*#NRP1)
LET#DX (#OF1-#OPP1)

SPT NO X Y Z
5150 #DX 0 #H1
(5250 #NX 100) ((#DX-#RP1) -#RP1) 0 #H1

Loop#1 #NRP1
 Spt No -(5150+100*#NRP1)
 Spts CP 10000 CQ 5000
Endloop

ENDIF

Unfortunately it gives me the same result, but thank you for hint. I was able to solve it with this syntax:

IF #PP==2
LET#NX (5050+100*#NRP1)
LET#DX (#OF1-#OPP1)
//SPT NO X Y Z
//5150 #DX 0 #H1
//(5250 #NX 100) ((#DX-#RP1) -#RP1) 0 #H1

LET#NR 5150
LET#POSX #DX
LOOP #NRP1
SPT NO #NR X #POSX 0 #H1
SPTS CP 10000 CQ 5000
LET#NR #NR+100
LET#POSX #POSX-#RP1
ENDLOOP

ENDIF