Developer forum
Showing results for 
Search instead for 
Did you mean: 

For-To-Next is ignoring subroutine object




I have set a subroutine with a custom 3d object which it shows as it should in 3D, the problem starts when I use a For_To_Next operation, the 3D object disappears totally.

If I use a more simple object the For_To_next works.


Calling the subroutine alone it works:



When For_To_Next is enable, nothing shows:



If I use exactly the same For_To_Next with a simple block object, it works:



I'm clueless about what is happening.





Try to use quotation marks for the subroutine id ("400"). This is just a wild guess.

Archicad 4.55 - 25 | HP Z840 | 2× E5-2643 v4 | 64 GB RAM | Nvidia Quadro M5000 @ Windows 10 Pro x64

`gosub 400` (which is totally valid!) and `gosub "400"` are different things, tho.

And what makes this unlikely is that the single `gosub 400` outside the loop works.


As mentioned, without the whole script everybody is blind.

AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»


The answer is probably in the subroutine itself.

What happens, if you put the block in a routine?.... Divide and Conquer!

AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Will do, didn't think about it.

If you post the whole script it would be easy to know what's happening.

But the first comment is likely the solution.

FREE Soffit & Fascia for Rail Tool -
FREE wall Accessory framing and coverings -
FREE Truss object -
FREE Custom Tube Object -
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

I will strip down my script and I will share it.

Barry Kelly

I just tried by putting the BLOCK in a subroutine and that worked fine.

So I would suspect something in the 400 subroutine.

Did you forget the RETURN maybe?



One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Thanks, I double checked and there is a return statment.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!