We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Conditional branching (again) - use of IFS

Jim Allen
Advisor

I really struggle with multiple conditions in GDL.

 

The IFS command seems to be the simplest and does what I want but the AC27 GDL editor doesn't like it.

 

I'm building a parametric manhole object, and need to set the size based on the depth and number of branches.

 

The parameters are these:

  • If there are more than 3 branches in the manhole (from the user inputs) - set the manhole length to 1370
  • If the manhole depth is greater than 900 (and there are fewer than 3 branches) - set the manhole length to 1250
  • If there are exactly 3 branches in the manhole (and the depth is greater than 900)- set the manhole length to 1030
  • Otherwise (if depth is less than 900 and there are fewer than 3 branches) - set the manhole length to 800

 

This would seem to do what I want according to the  user guide (https://helpcenter.graphisoft.com/user-guide/88992/)

 
IFS (numbranches>3, mhlength=1370, ZZYZX>900mhlength=1250,numbranches=3,mhlength=1030,TRUE,mhlength=800)
 
Yet I get this error when it is checked:
 

Missing CALL keyword (not recommended)

at line 56 in the Master script of file BG_Manhole_Rect_v0.1.gsm

 

Obviously I'm doing something wrong, I'm just not sure what. Any ideas?

Archicad 27 UKI | OS X 12.7.1 Monterey
3 REPLIES 3
runxel
Legend

Hey Jim, you're conflating GDL with Expressions here. So no wonder it does not work. What do you actually want to do?

GDL does not support IFS.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
A_ Smith
Expert

scroll to IF 

AC 22, 24 | Win 10

Thanks! 

 

Thanks makes sense - pity...

 

It's all documented in the original post - I think.

I'm going to have to turn that into horrible nested statements. I hate the GDL implementation of conditional branching ...grr...

 

On a more positive note, I'm going to use your LocatorLX script as a template for the 2D labels, most of the scripting is done, so that will save a lot of time.

I should then have some nice parametric manhole objects I can drop into a model use as connection points for drain runs, and schedule.

Archicad 27 UKI | OS X 12.7.1 Monterey