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

GLOB_ELEVATION questions

Anonymous
Not applicable
The following is code I have in an object that use to work when I put it on the first floor of a building. I thought I got it to work on all stories but know it isn't working again. I want the object to put the height on the plan whenever it isn't 18". But it's putting the height all the time. Could anyone give me any hints as to what it could be.

Thanks,
Michele

!GLOB_ELEVATION!to each story
!SYMB_POS_Z!to project zero
MUL2 GLOB_SCALE/96,GLOB_SCALE/96 !Autoscaling
IF ddoutlet=1 and GLOB_ELEVATION<18" OR GLOB_ELEVATION>18" THEN GOSUB 200
IF ddoutlet=0 and GLOB_ELEVATION<18" OR GLOB_ELEVATION>18" THEN GOSUB 100
IF ddoutlet=1 and GLOB_ELEVATION=18" THEN GOSUB 400
IF ddoutlet=0 and GLOB_ELEVATION=18" THEN GOSUB 300
IF Out=1 and GLOB_ELEVATION<18" OR GLOB_ELEVATION>18" THEN GOSUB 600
IF Out=1 and GLOB_ELEVATION=18" THEN GOSUB 667


END:
5 REPLIES 5
Anonymous
Not applicable
Michele,

Try writing the conditional this way.
IF ddoutlet=1 and GLOB_ELEVATION<>18" THEN...
This way seems to be what you intend because it says litteraly
IF ddoutlet equals 1 and GLOB_ELEVATION (IS NOT EQUAL TO) 18" THEN...

My guess is that AC stops evaluting your conditional statements
after the "and" expression when it evaluates to "true" and ignores the part after the "or" expression. Using parentheses to force AC to evaluate the
whole statement won't work in this context.

See if this alternate way works.
Peter Devlin
Frank Beister
Advisor
I think ddoutlet and Out is a boolean (0 or 1). Try this:

MUL2 GLOB_SCALE/96,GLOB_SCALE/96 !Autoscaling
IF ddoutlet=1 then
IF GLOB_ELEVATION=18" THEN GOSUB 400 ELSE GOSUB 200
ELSE
IF GLOB_ELEVATION=18" THEN GOSUB 300 ELSE GOSUB 100
ENDIF
IF Out=1 THEN
IF GLOB_ELEVATION=18" THEN GOSUB 667 ELSE GOSUB 600
ENDIF

If this does not work try the comapriion this way:

IF ABS(GLOB_ELEVATION-18")<0.0001 THEN ...

It's possible, that it's the with AC9 coming up precision problem.

But maybe the fault is in the subs.
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 tried both of your guys ideas and It didn't change. I still get 18" showing up. We have our notes in a detail tool and the object looks fine there. It's @ 18" and it doesn't show the text. If I paste it into the floor plan and don't change the height of the object it's fine. Once I change the height and then go back to 18" it keeps showing the height.

If you have any other ideas. It worked a couple of weeks ago and now all of a sudden it isn't working. UGGHHH!

THanks,
Michele
Anonymous
Not applicable
Here's some of the code - if that helps

300:!outlet @ 1'-6"
IF scale_size="48 scale" THEN GOSUB 301
DEFINE STYLE STYLE_3 "Arial", 35 * MIN (a, b), 7, 0
STYLE STYLE_3
PEN cpen

!***

PEN cpen
LINE2 0'-0.0000", 0'-2.0157"+1.375", 1'-9.6614", 0'-2.0157"+1.375"
LINE2 0'-0.0000", -0'-2.0157"+1.375", 1'-9.6614", -0'-2.0157"+1.375"
CIRCLE2 1'-4.0079", 0'-0.0000"+1.375", 0'-6.0000"
HOTSPOT2 0,+1.375",0
HOTSPOT2 1'-4.0079",+1.375",0

!***
!!!!!THis is moveable text hotspot and text for more_text

STYLE STYLE_3
PEN cpen
rot2 -symb_rotangle!!This rotate text to follow object
unID = 1

HOTSPOT2 0, dd_y,unID, dd_x,1+128 : unID=unID+1!!!THis is moveable hotspot placement
HOTSPOT2 -1, dd_y,unID, dd_x,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_x,2 : unID=unID+1

HOTSPOT2 dd_x, 0,unID, dd_y,1+128 : unID=unID+1
HOTSPOT2 dd_x, -1,unID, dd_y,3 : unID=unID+1
HOTSPOT2 dd_x,dd_y,unID, dd_y,2 : unID=unID+1

ADD2 dd_x, dd_y
TEXT2 0", 0",(more_text)!!the 0",0" is text hotspot placement
DEL 2

RETURN

THanks again,
Michele
Anonymous
Not applicable
I think I have a problem with the file because when I started a new dwg everything worked just fine! GOtta love problems!!!

Thanks for all your help,
Michele