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

Stair Stringer

Anonymous
Not applicable
This is the 3D script for a stair stringer. All the variables are right. I've checked them 3 times. If I end the script with m, r2, m, 0 right before 10: it does exactly what it's supposed to do. The rest of it is supposed to fill in the rest of the rises and runs. When I check script it says I have a missing Call keyword at the section in red. When I click continue it tells me that I need a string type expression at that same setion. I'm getting better at scripting but this one has me stumped. Am I going about this the wrong way? I know it's been good practice.

EDIT
Thanks for looking Dwight. I tried using gosub but it did the same thing. if I run it as it is shown now it works as before plus gives me the next step down. If I remove the ! from the 10: it doesn't seem to like having the 10: in the middle of the prism. Will a prism normally work with a line number in the middle of it?
ROTX 90
MATERIAL 81
L=NOR-3
STRW=11.25"
TH=(NOR*7.3125")+LF
TRW=RUN/NOTR
RISE=TH/NOR
ANG=ATN(RISE/TRW)
R2=RISE-1"
N=STRW/SIN(ANG)
M=R2/TAN(ANG)
F=N-M
Q=M-1.5"
U=(RUN-2.375")+Q
W=U-N
G=W*TAN(ANG)
V=TH-(RISE+1")
H=TRW-3.875"
I=3
!PRISM ((NOTR-2)*2)+8, 1.5",

PRISM 11, 1.5",
M, 0, N, 0, U, G, U, V, U-H, V,
U-H, V-RISE, U-(H+TRW), V-RISE,
!10:
U-(H+(TRW*(I-2))), V-(RISE*(I-1)),
U-(H+(TRW*(I-1))), V-(RISE*(I-1)),
!I=I+1
!IF I > NOR+3 THEN 20:
!GOTO 10:
!20:
M, R2, M, 0
10 REPLIES 10
Dwight
Newcomer
WHATIF:

GOTO 10:

IS:

GOSUB 10:

??
Dwight Atkinson
Anonymous
Not applicable
I made some changes to the script and did an edit above. How 'bout it Peter, you're the stairmaster!!
Anonymous
Not applicable
Hello Doug,
I did not think that one could
jump out of the parameters of a command
and go to a label. But to be sure, I tried
it with a very simple PRISM command
and got an error using goto and gosub.

I am curious about why you are not writing
the PRISM command in the normal manner
with each pair of x and y values on a separate line.
The code is more understandable this way.

I am not clear about why you would want
to jump out to a label.
Peter Devlin
Anonymous
Not applicable
In the prism I've designated 8 of the points. The number of points left are determined by the overall number of rises minus these points. I assume that I need to use a variable to accomplish this but not quite sure how to go about it. The # of rises, #of treads, and overall run of the stringer are input by the user. Basically I need to end the prism based on a variable.
Anonymous
Not applicable
Hello Doug,
I think you will need a FOR loop to do this.
Look at the code for the stringers in the
library part "Stair straight run.gsm" in
the concrete folder in the complete stairs folder.
You don't have to use the parameter buffer
but you need a FOR loop to fill the parameters
of the PRISM command based on the calculated
number of steps.
Peter Devlin
Anonymous
Not applicable
OK Peter, but if I put a for next loop outside the prism won't it repeat all the first points of the prism as well?
Anonymous
Not applicable
Hello Doug,
If you look at the script of the
lib part I mentioned you will
notice that some of the points
are not from the parameter buffer
but are in the command.
This is common in GDL.
Peter Devlin
Anonymous
Not applicable
I checked out the script that you mentioned Peter. Although I'm starting to get the hang of this, it's going to take a few to understand exactly what it's doing. If you have any insight I'd appreciate it. Doug


Edit:

I found "Put"..."Get"..."Use"...NSP" in the manual. I'm starting to see how it works.
Anonymous
Not applicable
Hello Doug,
I wrote a small 3D script that I hope shows how
the FOR NEXT loop and PUT GET work.

The 3D script is as follows.


numriser=5 !!!number of risers
riserht=7" !!!riser height
trdp=11" !!!tread depth

width=3'-0" !!!stair width

!!!-------------------------------------
put 0,0
put 0,riserht

for i=1 to numriser step 1
put (i-1)*trdp,i*riserht
put i*trdp,i*riserht
next i

put trdp*numriser, riserht*(numriser-1)
put trdp,0
!!!--------------------------------------

material 18
pen 1

rotx 90


prism nsp/2,width,
get (nsp)

del 1
end

I hope this helps
Peter Devlin