BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Request - Current Story Height

muril00ng
Enthusiast
Hello everyone,

I have been doing tests in 2D script about REQUEST options, when I write this text:


n = REQUEST ("Story_info", expr, nStories,index1, name, elev, height)

text2 0,0, height


In 2D preview, the value "height" shows the height of Ground Floor. In this case, I want that it shows the height the current floor (if some project has many stories).

In versions before AC 20 the GLOB_CSTORY_HEIGHT variable was a solution.

What do you suggest?

Thanks in advance.
____________________________________
Murilo Noleto
http://www.kilobim.com.br/
AC 12 - 27 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X
5 REPLIES 5
Barry Kelly
Moderator
GLOB_CSTORY_HEIGHT should still be fine if used in the 2D script.
Just don't use it in the Parameter (or Master) script.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
muril00ng
Enthusiast
Thanks Barry!

Now, if we bring this example to Parameters script.


n = REQUEST ("Story_info", expr, nStories,index1, name, elev, height)

parameters cstory_height = height



When I go to Parameters List, the value of cstory_height parameter (that I have created) is always of the ground floor one.

Is there a simple way to replace the info about the Current Story?
____________________________________
Murilo Noleto
http://www.kilobim.com.br/
AC 12 - 27 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X
Barry Kelly
Moderator
From the GDL manual is says ...
If expr is a numerical expression, it means a story index: only the number of stories and the information on the specified story is returned.
So if you have 'expr' and a number (say 0) then you will get info only for the storey starting at story 0.
Not sure how this works in the USA version as there is no 0 story.

If you set it to 1 then you will get info for story 1.

I think your problem will be you can't REQUEST the story because that can only be done in the 2D script - where you then can't save parameters.
You can't REQUST the current story in the parameter script because this can no longer be done.

If you set 'expr' as a string then you can get all info for all storey as an array.

Again from the manual ...
DIM t[]
n = REQUEST ("STORY_INFO", "", nr, t)
FOR i = 1 TO nr
nr = STR ("%.0m", t [4 * (i - 1) + 1])
name = t [4 * (i - 1) + 2]
elevation = STR ("%m", t [4 * (i - 1) + 3])
height = STR ("%m", t [4 * (i - 1) + 4])
TEXT2 0, -i, nr + "," + name + "," + elevation + "," + height
NEXT i
REQUEST Story_Info will work in 2D and parameter scripts.

I just don't know a way that you can find the current story in the parameter script so you can save a parameter with the height for that story.

Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
muril00ng
Enthusiast
I got it!!!!

The solution of my case was to use the "Story_Info" request (as you told me) and creating parameters (with arrays) using the request extracted data.
After that I called the "Home_story" request in order to get the proper "index" of current story.

With a combination of this parameters I could find the current height.

With GLOB_CSTORY_HEIGHT things were pretty much easier. Now the road is more winding.

Thanks Barry for help.
____________________________________
Murilo Noleto
http://www.kilobim.com.br/
AC 12 - 27 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X
im a little late to this but the elevator object is where i learned how to do all of that with the stories. I use it in so many objects.
Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!