Getting the Story Index Number
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-06-21 02:56 PM
‎2004-06-21
02:56 PM
I found the reference for
REQUEST ("Story", "", index, story_name)in the GDL reference manual, but I'm not really sure what to do with it from there.
I tried using the index in the context of
Zname = index + Zname, but Archicad gives me an error "Unused function return value."
Can anyone shed some light on this for me?
Thanks!
Tom Waltz
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-06-21 03:08 PM
‎2004-06-21
03:08 PM
sorry, that should have been
ROOM_NUMBER = sindex + ROOM_NUMBERnot zname.
Tom Waltz
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-06-21 04:12 PM
‎2004-06-21
04:12 PM
Tom,
For some reason you always have to set a variable equal to the Request function, i.e.:
Generally I think the return value is 1, 0, or -1 depending on the Request function. I have rarely (if ever) used this value so I generally just put a dummy variable in to make the error go away.
The variable story_index will contain the number of the story but this may not match the story structure of your building. You may need an adjustment parameter for those cases.
For some reason you always have to set a variable equal to the Request function, i.e.:
story_ID_OK = REQUEST ("Story", "", story_index, story_name)Otherwise you get the error message. It actually does not interfere with the function of the part. The error only shows up when you check scripts.
Generally I think the return value is 1, 0, or -1 depending on the Request function. I have rarely (if ever) used this value so I generally just put a dummy variable in to make the error go away.
The variable story_index will contain the number of the story but this may not match the story structure of your building. You may need an adjustment parameter for those cases.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-06-21 08:26 PM
‎2004-06-21
08:26 PM
That was it.
Here is how it ended up:
Here is how it ended up:
story_ID_OK = REQUEST ("Story", "", story_index, story_name) ! adjust +1 for Euro-style flr numbers IF story_index < 0 THEN Fix_Val = 0 ELSE Fix_Val = 1 ENDIF ROOM_NUMBER = STR (story_index+Fix_Val,1,0) + ROOM_NUMBER
Tom Waltz
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2004-06-22 11:00 AM
‎2004-06-22
11:00 AM
I think the reason you have to assign the return value of a REQUEST function to a variable is so that you are able to evaluate whether the REQUEST function was successful or not. If there was some error, the REQUEST function will return the value -1. Otherwise it will return the number of values filled into the variables named in the REQUEST function (this number can be different with each different REQUEST function).
This way of operation may be useful for debugging your GDL code.
Laszlo
This way of operation may be useful for debugging your GDL code.
Laszlo
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28