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

ok - I need help on this simple command

Anonymous
Not applicable
I beat my head against the wall for too long yesterday (read: all day) so now I present it to yall to make me see my simple error that I can't seem to find.

I am running a for loop and when the for loop reaches a certain point, I want to change the value of a variable for creation of a cylinder. See the code:

stopper = (courses - tcxn) ! (turns out to be 6)
FOR coursenum=1 TO courses STEP 1

IF coursenum > stopper THEN ! why is this not working?
clx = 5
ELSE
clx = 1
ENDIF

GROUP "keeper"
CYLIND clx, A/2
ENDGROUP
GROUP "loser"
ADDy -stack
CYLIND clx, A/2
DEL 1
ENDGROUP
finallog = SUBGROUP("keeper","loser")
PLACEGROUP finallog

NEXT coursenum



SOOOOO why are the cylinders not being created at different hieghts? when coursenum reaches 7 (>6) the cylinders should start being created at 5 instead of 1. Is there something I don't know about the GROUPing command that could be causing the problem? I KNOW it shouldn't be this difficult but I just can't seem to find where I am going wrong.
6 REPLIES 6
gerd
Participant
I tried a little with archicad 7: no group command, so I deleted all related lines.
result: I saw only 2 cylinds, but different heights. I added the addx command at the end: it worked. so it seems not to be a problem of the line you marked but with placement of the parts or with group commands

maybe this is what you need (?) or perhaps it helps (?)
best regards, g
Anonymous
Not applicable
ok - so I remove all the grouping work and I can see the top courses being extended. But I need the grouping commands so that I can do the solid object operations.

Is there another way I can do my 'cutting' without using the group commands? I look through the ArchiCAD help GDL Reference sectiona nd I can't find anything.

What is it, then, about the grouping that is not allowing a change of the clx variable?
Anonymous
Not applicable
well I'm working around the issue by multiplying my code but it is semi-working now. It would sure be easier if I could modify that variable. anyone else?
Frank Beister
Moderator
With GROUP ENDGROUP you define something like a makro. With the additional statements SUBGROUP etc. you can operate between the groups and generate by this a new group. With PLACEGROUP it will be made visible. All other statements just declare the shape, but are not generating something to the model. All theory and not proofed by myself, but sounds simple and logical.

What value has stack? It sould be 0<stack<a/2.
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
Aussie John
Newcomer
sirduncan wrote:
code:

stopper = (courses - tcxn) ! (turns out to be 6)
FOR coursenum=1 TO courses STEP 1

IF coursenum > stopper THEN ! why is this not working?
clx = 5
ELSE
clx = 1
ENDIF
It is the end of the day here so I might be missing something but how can coursenum ever be larger than stopper unless tcxn is negative since the max value coursenum can ever have is courses.
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]
Anonymous
Not applicable
Thanks, everyone, for your comments and thoughts. I have it working now very close to what I am looking for. I had to work around it and add a significant amount of code to the object, but it is working now.

It wasn't the IF check on coursenum and stopper that wasn't working. What wasn't working was that inside of the GROUP command, my variable wasn't taking on the new value. Why? I don't know. And now I don't really care because instead, I made a second variable and adjusted that one as needed. So now that works.

Now onto the next stage. It sure would be easier if I could get my hands on that GDL cookbook. Anyone know where I can get one?

Thanks again for your help.