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

Adding Request to script

Anonymous
Not applicable
I am trying to add a request string to a library part. I have the correct request:

n=REQUEST ("Zone_relations", "", category_name, code, name, number ,category_name2,
code2, name2, number2)

TEXT2 0, 0, number


but do not know the code to make it a string/parameter within the part.

New to GDL and hope someone can help??
10 REPLIES 10
Rob
Graphisoft
Graphisoft
Fred,

try to put this in the parameter script

n=REQUEST ("Zone_relations", "", category_name, code, name, number ,category_name2, code2, name2, number2)

PARAMETERS name=name

I am assuming that you have created the parameter 'name' in the parameter list...
::rk
Anonymous
Not applicable
Robert,

Thanks for your reply.

Yes I have tried this:

Master script:
n=REQUEST ("Zone_relations", "", category_name, code, name, number ,category_name2,
code2, name2, number2)


Parameter Sript:
PARAMETERS number=number

PARAMETERS name=name


Parameters:
Variables name + number (type - ABC)

No joy - I am trying to extract a room number from a zone that the
object is placed in for room data sheets.

Have I got the sequence wrong?
Frank Beister
Moderator
This is again the problem that some REQUESTs do not return a valid value in the moment PARAMETERS works proper. Other way round PARAMETERS does not any affect to the denoted parameter, when the REQUEST offers the searched values.

One of these cases is the zone-relation request. Sorry. No hope to transfer the result to a parameter by parameters. Use in 2D-script, but not in parameter script.

You are the third (I know from) in the last half year, who tried this. No chance IMHO.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
F. wrote:
You are the third (I know from) in the last half year, who tried this. No chance IMHO.
Fourth. Very frustrating.
James Murray

Archicad 27 • Rill Architects • macOS • OnLand.info
Anonymous
Not applicable
Thank you all. Will revise my approach to this problem. Thanks for stopping me go down the wrong road.

Fred
Anonymous
Not applicable
Fred wrote:
Yes I have tried this:

Master script:
n=REQUEST ("Zone_relations", "", category_name, code, name, number ,category_name2,
code2, name2, number2)


Parameter Sript:
PARAMETERS number=number
Wouldn't it work to use:
PARAMETERS MY_room_number = number
Where "MY_room_number" is a named parameter in the list?
Frank Beister
Moderator
No, it wouldn't, because number is "" in any moment PARAMETERS works.

You are right, to write

if not(number="") then PARAMETERS number=number

would be better, but this does not work too. See above.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
I just tried putting the whole bit into the master script to see if the execution order would be different. Strangely the part works outside of a zone, but once moved inside the symbol vanishes leaving only the big dot. This is despite having a Rect2 in there to make sure it wasn't just the text disappearing.
Frank Beister
Moderator
I should have known, that you would try. 😉 Maybe the request changes the variable from string to numeric. wrap a if vartype(number)=2 then ... around it.

See the following threads:
http://archicad-talk.graphisoft.com/viewtopic.php?t=8856&postdays=0&postorder=asc&highlight=write+file&&start=0
http://archicad-talk.graphisoft.com/viewtopic.php?t=10858&postdays=0&postorder=asc&highlight=write+file&&start=0

The last one shows how to write out the values into a text file to see the context, script type and value in each running.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm