Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

simple way for knowing, what level is the insertion-Level of an library-part?

Hmooslechner
Expert
Now, i am on an GDL for a Stairway for all levels of a building at once.

I would like to script a kind of error-message that the User is informed, to insert it at the cellar, the 0-Level in Archicad, but i didnt find a simple way to get the internal Info, in which Building-Level-Number the project, this GDL is really inserted by the User.

Dont tell me about GLOB_HSTORY_ELEV and so on.. -i have tried it without some success..

I just want the user to know - "You inserted it in the wrong Building-Level - delete it and put it in the deepest."


Maybe, it would be better to automaticly insert it "right".. Have to think about it..

Its something like this:
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
5 REPLIES 5

Anonymous
Not applicable
Hi Hmooslechner,
If I understand you correctly, you can trigger a GDL Print Message when the user makes an improper entry.
Hope this helps.

Barry Kelly
Moderator
This is just off the top of my head.
Could you use ...

n = REQUEST ("Story_info", expr, nStories, index1, name1, elev1, height1 [,index2, name2, ...])

to get all of the storey info.

An example from the GDL 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

Determine which storey has the lowest elevation and then compare that to the home storey of the object.
If they don't match then print your warning.

But that assumes you want to actually place it on the lowest storey - that could be a dummy storey.
Only you will know if that is a solution for you (i.e you never have lower dummy storeys).


Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Podolsky
Mentor
In the earlier versions use of PRINT in GDL did create additional warning window. But now by default all GDL warnings are in Session Report, that user is not usually looking at.
Maybe you can type message directly on the object (as soon as object needs to be deleted - the message on the floor plan is not bad idea).

You also can try this method - I guess your stair is floor sensitive already and shown on all floors - just shift Z of the stair to the position, where it needs to start (for example ADDZ -GLOB_ELEVATION-GLOB_HSTORY_ELEV), then it doesn't really matter on which floor it was placed initially.

Hmooslechner
Expert
Thanks - i did it this way and in 3D its working fine.



n = REQUEST ("STORY_INFO", "", nr, t).   !! from GDL-reference..had this anyway in the masterscript..

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])
	Geschosshoehe = t[4 * (i - 1) + 4]

		Geschosshoehen = Geschosshoehe

NEXT i


!! This puts it in the right hight, no matter where its inserted in the Project.
ADDZ -GLOB_HSTORY_ELEV-Geschosshoehen[1]


In 2D, i still have some problems to solve, but this is my task now.
Here in Austria, its normal to have cellars below zero, but elswhere it could be different and my GDL needs a story below zero. Otherwise its making silly things. More brainpower to use - hope its there in me..

Thank You all!
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1

Here is a link to all my stairs and railings, probably some useful things

https://bit.ly/3yKvn7q
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!