cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.
SOLVED!

GDL VALUES Command error Key Word

TLOTrike
Contributor

I am having a bit of bother with an old GDL object I made years ago.

Its a simple object with various screw and fixing types. Each type is on a Fragment. I have added to Fragment 16 a new screw type and I have added it to the Parameter section of the object so the User can choose whichever fixing type they want.

Problem is I am getting the following error...

Keywords can't be used as variables at line 1 

 

Below are the VALUES but I'm not spotting which one is a "key word"

 

VALUES "fixtype"  "screw" , "expansion bolt" , "bolt head", "bolt side elev", "BG-screw-40mm", "BG-screw-25mm", "MF Panhead", "Screw rawlplug", "Tek Screw", "Self Tap", "Pop Rivet", "Hex Head", "Insulation Dowel", "Self Tap Hex Head", "MF Pan Head Elev",

IF fixtype="screw" 					THEN Gosub 1

Etc...

 

Anyone able to spot where it is going wrong?

Thanks

Graeme
Windows 11 ArchiCAD 28.3.0 (earliest version used ArchiCAD 3.4)

Windows 11 ArchiCAD 28.3.0 (earliest version used ArchiCAD 3.4)
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
runxel
Hero

You have a trailing comma in the end of your "VALUES" command.

This the list spills over to the "IF", which of course is a reserved keyword. This is also why this is still counted as line 1.

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | 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»

View solution in original post

7 REPLIES 7
Yves
Expert

Salut,

 

"MF Pan Head Elev" !!!!,

 

Yves Houssier
Belgium
Archicad 19 -> 24
iMac - Mac Os 10,13

Salut, 

I've tried changing the variable name to "fixtyp" but no luck. I've also reverted the object back to only use 15 FRAGMENTS but again it is still not liking it.

 

I blame Windows 11 which I upgraded to yesterday 🙂

Windows 11 ArchiCAD 28.3.0 (earliest version used ArchiCAD 3.4)
Yves
Expert

You must remove the last comma "," after the "MF Pan Head Elev"

Yves Houssier
Belgium
Archicad 19 -> 24
iMac - Mac Os 10,13
Solution
runxel
Hero

You have a trailing comma in the end of your "VALUES" command.

This the list spills over to the "IF", which of course is a reserved keyword. This is also why this is still counted as line 1.

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | 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»

Thanks, sorted now 👍

 

Plus I also discovered the limit of 256 characters was breached as well so had to shorten the names to make it happy again.

 

G

Windows 11 ArchiCAD 28.3.0 (earliest version used ArchiCAD 3.4)

No need, after a comma you can go into the next line without trouble. I would even recommend that.

Nobody likes long lines.

And if you need to go to a new line somwhere where a comma is not allowed, you can just use the backslash instead.

 

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | 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»
greg_lupo
Booster

You can use Array as a list of values. Ir clear to read and manage count and order. Also If You'd like to change list conditionally

dim names[]:i=1
names[i] = "screw"                   :i=i+1
names[i] = "expansion bolt"          :i=i+1
names[i] = "bolt head"               :i=i+1
names[i] = "bolt side elev"          :i=i+1
names[i] = "BG-screw-40mm"           :i=i+1
names[i] = "BG-screw-25mm"           :i=i+1
names[i] = "MF Panhead"              :i=i+1
names[i] = "Screw rawlplug"          :i=i+1
names[i] = "Tek Screw"               :i=i+1
names[i] = "Self Tap"                :i=i+1
names[i] = "Pop Rivet"               :i=i+1
names[i] = "Hex Head"                :i=i+1
names[i] = "Insulation Dowel"        :i=i+1
names[i] = "Self Tap Hex Head"       :i=i+1
names[i] = "MF Pan Head Elev"        :i=i+1

VALUES "fixtype" names