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

2d profile of rafter

Anonymous
Not applicable
i want an x to appear inside the contour of a rafter in section view. i tried the plane command, but that only worked for floor joists as they are horizontal. i've been trying to use the tube command...but i don't really understand it. needs to be something that allows me to put two intersecting planes at the same angle as the roof
11 REPLIES 11
Anonymous
Not applicable
I don't think you need the TUBE command to do what you want.
Which command are you using for the rafter object ?
What method are you using to pitch the rafter object ?
Thank you,
Peter Devlin
Anonymous
Not applicable
if gs_detlevel_3d=0 then end

PEN gs_cont_pen
MATERIAL roof_mat


ALPHA=ABS(ATN(COS(G)*TAN(P)))
M=A*TAN(ALPHA)
N=H/COS(ALPHA)
T=T/2
U=T/SIN(G)
W=W/2
D=ABS(90-G)
S=W/COS(D)

IF G<0 THEN V=0 ELSE V=1
IF G>90 THEN V2=0 ELSE V2=1



unID=1
HOTSPOT 0,-B/4,(H/2)/(cos(ALPHA))-(A/2*tan(ALPHA)),unID=unID+1 !! Hotspots in axis
HOTSPOT A/2,-B/4,(H/2)/(cos(ALPHA)),unID=unID+1

HOTSPOT U,0,-A*tan(ALPHA)+U*tan(ALPHA),unID=unID+1 !! lower Hotspots
HOTSPOT A-S,0,-S*tan(ALPHA),unID=unID+1

HOTSPOT U,0,-A*tan(ALPHA)+U*tan(ALPHA)+H/2/(cos(ALPHA)),unID=unID+1 !! middle Hotspots
HOTSPOT A-S,0,-S*tan(ALPHA)+H/2/(cos(ALPHA)),unID=unID+1

HOTSPOT U,0,-A*tan(ALPHA)+U*tan(ALPHA)+H/(cos(ALPHA)),unID=unID+1 !! upper Hotspots
HOTSPOT A-S,0,-S*tan(ALPHA)+H/(cos(ALPHA)),unID=unID+1




ADDZ -M
ROTX 90

ADDX U

ROTY G

CUTPLANE 1, 1, 0, V !Cut at the Bottom1
DEL 2

IF G<90 THEN GOSUB 1 ELSE GOSUB 2


ADDX A-S
ROTY G

CUTPLANE 1, 1, 0 !Cut at the top1
DEL 2

ADDX A-S
ROTY G-90

CUTPLANE 1, 1, 0, V2 !Cut at the top2
DEL 2
ADDZ -B/2
PRISM 5, B,
0, 0,
A, M,
A, M+N,
0, N,
0, 0


CUTEND
CUTEND
CUTEND
CUTEND

plane 4, 0.006,0,0,0.006,-b/2,h,a-.006,-b/2,h,a-.006,0,0
plane 4, 0.006,0,h,0.006,-b/2,0,a-.006,-b/2,0,a-.006,0,h

DEL TOP
END




1:

ADDX U
ROTY G+90
CUTPLANE 1, 1, 0, V !Cut at the Bottom2
DEL 2
RETURN

2:

ADDX U
ROTY G-90
CUTPLANE 1, 1, 0, V !Cut at the Bottom2
DEL 2
RETURN



so that's the code right now. p is an angle type variable that the tells the rafter what pitch the roof is and i only see it mentioned once in the alpha equation up at the top. you can see where i slapped the plane command in there.
Anonymous
Not applicable
I don't see where you rotate the PLANE commands in the same way
you rotate the PRISM_ command. It seems to me you need to do this.
I have an object that displays these crossed lines in section and
it uses the POLY_ command so I don't have to worry about it
being planer as one does using the PLANE command.
Peter Devlin
Anonymous
Not applicable
where is the rotate command for the prism in there?
Anonymous
Not applicable
You are right. There is no ROT command.
I am unable to understand your code because
I do not know what all of the parameters and
variables are. The variable/parameter "H" for example.
It does me no good to copy your code into a new
object to see how it works because of this.
Peter Devlin
Anonymous
Not applicable
i looked in the other script windows but didn't see any rot commands. yesterday i tried roty p and thought it would match the roof slope but the angle wasn't right. the only thing right was that it was rotating around the right axis. i thought maybe the g variable would have some kind of affect on it since that is the angle the rafter rests against the ridge. but i can't seem to wright the right script. you mentioned poly_. if i were to use that here instead would i have use the rot command along with it?
Anonymous
Not applicable
For the reasons I mentioned, I can't understand your code
so I am unable to answer your questions.
I am guessing that the reason why ROT p did not work
was that the local origin of the beam element was at
the underside beginning and not at the top side beginning.

What I can do, if you like, is send you the object that
I wrote that works and does what you want.
You can study the code and see how the crossed lines
are coded. This object is somewhat complicated because
I wanted it to have seat cuts and plumb miter angles etc.
You can ignore all that and just see how the beam and
the cross lines are coded.
Peter Devlin
Anonymous
Not applicable
i would appreciate it. thank you
Anonymous
Not applicable
Please post your e-mail address or e-mail me
with your address so I can send you the library part.
My e-mail address is in my signature.
Peter Devlin