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

Changes with Layer Combinations

Anonymous
Not applicable
I'm reading about the global variables and I'm wonderingif I can make an object perform differently dependant on which layer combination is currently in use? I realize that layer combinations are different from company to company, but I only need it to work for our company. Is there anyway to access this information - or make these changes?
14 REPLIES 14
Anonymous
Not applicable
FMR if you could send me that file I would sure appreciate it. I just can't get why its not working for me. My logic seems very simple and right. Please do send that if you could. Thanks.
Anonymous
Not applicable
ok - I find that I can not do any IF comparisons on any of the values that come out of the request call. I can get the number of characters using the STRLEN function, I can get the number of values returned in my temp var - I can output the values using TEXT2, but if I try to do an 'IF name="something" THEN or even an 'IF number = 101 THEN', it doesn't give me an error, but the 2D symbol is broke in floor plan. Just a green, non-selectable dot.

UGH. I'm getting frustrated. I have it all working properly except that I can't do that IF comparison. Does ANYONE have any light and knowledge you could share with me on this one? I just don't get it.

As far as I can tell, the 'name' values that comes out is considered a string, but I can't compare it against a string. The number value is an integer (the number of the zone), but I can't compare it against another integer or it crashes without error - just doesn't show.

Please, please please - someone step up with a brilliant answer. I'm getting desperate. I need to get this object done and I am finding this is my only way of doing it - except that it isn't working. ugh.
Anonymous
Not applicable
What line is the check scripts function identifying?

If it is the line with the REQUEST function, then you probably need to initialize the variables first. Following is an example from a script I recently wrote for a client (so I know it works).

room_name = "CLASSROOM"
room_no = "101"
cat_name = ""
cat_code = ""
r = REQUEST("Zone_relations", "", cat_name, cat_code, room_name, room_no)

Variables are numeric by default and it appears that the REQUEST function does not initialize them on its own. Note that the room number value is also a string.
Laszlo Nagy
Community Admin
Community Admin
sirduncan wrote:
On a continuing thought here - --

I have it pulling the information now, but my if statement is failing. ie.

zoneexists = REQUEST ("Zone_relations", "", category_name, code, name, number)

TEXT2 3,1,name ! this prints the 'name' of the zone it is in

IF name="FOUNDATION" THEN ! this gives me an error (see below)
TEXT2 3,1,name
ENDIF


The error I am getting on that if statement is this:

"Incompatible types in expression at line xxx of the file xxx.gsm (System error -1)"

Anyone care to venture a guess on this? I have seen this near same code on these boards and everyone says it should work, but it is not. Help.
I might be wrong, but I think this error message comes when the program gets a variable that is different from what it expects. For example, it expects a number, but the variable is a string.
You should check with the Debugger if this is the case.
In the Debugger, you can list variables and you will always see their type and value at each step of the code.
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
Anonymous
Not applicable
"If it is the line with the REQUEST function, then you probably need to initialize the variables first. "

Thanks Mathew, it looks like that did the trick. I'm guessing that the 'name' that was coming out of the request function had an undefined variable type. By intitallizing the variable as a string before making the request call, it comes back as a variable and I am now able to do string comparisons on them. Thank you.

I'm finally close to haveing it done.

Thanks for your answers everyone. This is why I love ArchiTalk so much - Answers!