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

DNC's bendy bar tool from 7 to 8.1

I used David's bendybartool (which comes with many other great objects in his GDL Cookbook) in a project I started in 7 and am now completing on 8.1.

I used it to make rain pipes which looked very rain-pipe-like on 7 and now on 8.1 shows what look like one of the end cylinder faces. The 2D looks as it always did.

Is there anything in bendybar's code that should get modified when migrating to 8? I am very tight on a deadline and that's why I am asking this here and not privately to David (who has always been great with support, by the way).

[bendybartool makes a bent-pipe type thing by alternating CYLINDs and ELBOWs with custom lengths, bend, twist, and curvature radius set by custom array parameters.]
12 REPLIES 12
Jochen Suehlo
Moderator
This is a very strange behavior. I tested the object in AC8.1 and find the same as you.
When I change the array parameters name in the parameter field and in the script, it works better, but not well.
It must have to do with the arrays; they are declared 2 times: first in the parameter field, second in the master script, which is not necessary.
But if you delete the master script definition it will not work better.

You should test to write the object complete new in AC8.1 and leave out every part of the script that is not necessary, maybe this helps.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Jochen Suehlo
Moderator
Okay, shooten too fast.

It was definetely the second defining of the Arrays in the master script that caused the strange behavior.

This script should work (in the master):

n=SPLIT(shape,"%n",shp)

brad=diam/2000 !Bar radius
FOR k=1 TO shp-1
IF crad<brad THEN crad=brad
IF bend<0 THEN
twist=twist+180
bend=ABS(bend)
ENDIF
IF leng<0 THEN leng=0
NEXT k
IF leng[shp]<0 THEN leng[6]=0
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
Ignacio and Joachim,
Do you have the revised version of this library part?
I notice that my copy has the statement somthing like
"April, revised 00".

I copied Joachim's code into DNC's master script
to compare them and Joachim's code is identical to DNC's code.
I did notice that in the master script DNC had comented out
the declaration of the three arrays with a comment that
in AC 8 you can't declare an array in the master script if it is already declared in the parameter list.
I also noticed that DNC comented out the statement,
brad=diam/2000 and substituted brad=diam/2.
Peter Devlin
Hi David, Joachim.

I think we are talking of the same version of bendibartool.
[!Bendibar
!Reinforcing bars
!David Nicholsoncole
!April 99
!Modified Jan 00]
And yes, David, my Master Script looks exactly like what Joachim pasted. Mine does not show the brad=diam/2000 to brad=diam/2 change you mention, so obviously there is at least one other difference somewhere else in the code.

I am new to 8 and have not checked the changes to GDL yet, and have not the slightest clue as to what may be producing the problem.
Ignacio wrote:
Hi David, Joachim.
(...)
And yes, David,
[Sorry about that. That should have been Hi, yes, *Peter*, Joachim.]
Anonymous
Not applicable
Ignacio,
Some time last year DNC posted on GDL TALK that in AC 8 you can't
declare an array in the master script if it is already declared in the
parameter list. I therefore changed the master scrpt for "Bendibar"
in the maner shown below and it works in AC 8.

Notice that the DIM statement is commented out.
Also notice that the brad=diam/2000 is commented out
and replaced with brad=diam/2. I changed this because I couldn't
figure out why it was defined that way.
You can leave this the way it is if you want but if you do change it
check the 3D script and make sure that it also says brad=diam/2.


!Bendibar
!Reinforcing bars
!David Nicholsoncole
!April 99
!Modified Jan 00

!!!DIM leng[7],crad[6],twist[6],bend[6]

!This is the long hard
!way to parse a value list
IF shape='1_Single Segment' THEN shp=1
IF shape='2_Two Segment' THEN shp=2
IF shape='3_Three Segment' THEN shp=3
IF shape='4_Four Segment' THEN shp=4
IF shape='5_Five Segment' THEN shp=5
IF shape='6_Six Segment' THEN shp=6
IF shape='7_Seven Segment' THEN shp=7

!If all you want is a flag
!then use SPLIT() instead
n=SPLIT(shape,"%n",shp)

100:!parameter checks
!!!!!brad=diam/2000 !Bar radius

brad=diam/2 !Bar radius

FOR k=1 TO shp-1
IF crad<brad THEN crad=brad
IF bend<0 THEN
twist=twist+180
bend=ABS(bend)
ENDIF
IF leng<0 THEN leng=0
NEXT k
IF leng[shp]<0 THEN leng[6]=0

Let us know if this fixes the problem,
Peter
Anonymous
Not applicable
Ignacio,
Some time last year DNC posted on GDL TALK that in AC 8 you can't
declare an array in the master script if it is already declared in the
parameter list. I therefore changed the master scrpt for "Bendibar"
in the maner shown below and it works in AC 8.

Notice that the DIM statement is commented out.
Also notice that the brad=diam/2000 is commented out
and replaced with brad=diam/2. I changed this because I couldn't
figure out why it was defined that way.
You can leave this the way it is if you want but if you do change it
check the 3D script and make sure that it also says brad=diam/2.


!Bendibar
!Reinforcing bars
!David Nicholsoncole
!April 99
!Modified Jan 00

!!!DIM leng[7],crad[6],twist[6],bend[6]

!This is the long hard
!way to parse a value list
IF shape='1_Single Segment' THEN shp=1
IF shape='2_Two Segment' THEN shp=2
IF shape='3_Three Segment' THEN shp=3
IF shape='4_Four Segment' THEN shp=4
IF shape='5_Five Segment' THEN shp=5
IF shape='6_Six Segment' THEN shp=6
IF shape='7_Seven Segment' THEN shp=7

!If all you want is a flag
!then use SPLIT() instead
n=SPLIT(shape,"%n",shp)

100:!parameter checks
!!!!!brad=diam/2000 !Bar radius

brad=diam/2 !Bar radius

FOR k=1 TO shp-1
IF crad<brad THEN crad=brad
IF bend<0 THEN
twist=twist+180
bend=ABS(bend)
ENDIF
IF leng<0 THEN leng=0
NEXT k
IF leng[shp]<0 THEN leng[6]=0

Let us know if this fixes the problem,
Peter
Anonymous
Not applicable
Ignacio,
Some time last year DNC posted on GDL TALK that in AC 8 you can't
declare an array in the master script if it is already declared in the
parameter list. I therefore changed the master scrpt for "Bendibar"
in the maner shown below and it works in AC 8.

Notice that the DIM statement is commented out.
Also notice that the brad=diam/2000 is commented out
and replaced with brad=diam/2. I changed this because I couldn't
figure out why it was defined that way.
You can leave this the way it is if you want but if you do change it
check the 3D script and make sure that it also says brad=diam/2.


!Bendibar
!Reinforcing bars
!David Nicholsoncole
!April 99
!Modified Jan 00

!!!DIM leng[7],crad[6],twist[6],bend[6]

!This is the long hard
!way to parse a value list
IF shape='1_Single Segment' THEN shp=1
IF shape='2_Two Segment' THEN shp=2
IF shape='3_Three Segment' THEN shp=3
IF shape='4_Four Segment' THEN shp=4
IF shape='5_Five Segment' THEN shp=5
IF shape='6_Six Segment' THEN shp=6
IF shape='7_Seven Segment' THEN shp=7

!If all you want is a flag
!then use SPLIT() instead
n=SPLIT(shape,"%n",shp)

100:!parameter checks
!!!!!brad=diam/2000 !Bar radius

brad=diam/2 !Bar radius

FOR k=1 TO shp-1
IF crad<brad THEN crad=brad
IF bend<0 THEN
twist=twist+180
bend=ABS(bend)
ENDIF
IF leng<0 THEN leng=0
NEXT k
IF leng[shp]<0 THEN leng[6]=0

Let us know if this fixes the problem,
Peter
Peter wrote:
Some time last year DNC posted on GDL TALK that in AC 8 you can't
declare an array in the master script if it is already declared in the
parameter list. I therefore changed the master scrpt for "Bendibar"
in the maner shown below and it works in AC 8.(...) Also notice that the brad=diam/2000 is commented out
and replaced with brad=diam/2. I changed this because I couldn't
figure out why it was defined that way.
Great, that did it and sort of saved my life at the last minute. Thank you so much.

Regarding the 2 vs 2000: I would guess you are using feet and inches for configuring the pipe diameter and therefore not needing to set the "Diam. of Bar in Millimetres" as originally intended. Internationally pipe diameters are given in mm and GDL will use m as its length unit, so that's why the /2 became /2000 in the script.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!