cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

GDL
About building parametric objects with GDL.

Conditional branching (again) - use of IFS

Jim Allen
Expert

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 | 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 |

«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