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

???????

Red
Advocate
If you can make it through this mess!

Can someone please help me with this one!! I added a lot of script below to help provide my point. Anyway every one of these rafters is working correctly except for 9”ø. Maybe I have fat finger somewhere along the way, but I can not find it. But the very very very weird thing is that I can replace B = 0’-9” and H = 0’-9” with 8”, 8 7/8”, 10”, etc…… and leaving HLH_Rafter_Code still equaling as it was a 9”ø and it worked perfectly!! It’s only messing up when 0’-9” is placed at B and H.

After messing with it a little longer I figured out the problem is with B. I can make H equal anything and leave B at 9” and it doesn’t work, but to get it to work I tried a greater than less than statement B > 8 15/16" and B < 9 1/16" and it works great!! Once again it maybe a simple mistake somewhere, but for the life of me I can not find it.



!7"ø
if B = 0'-7" AND H= 0'-7" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="RT708S1S"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="RT710S1S"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="RT712S1S"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="RT714S1S"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="RT716S1S"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="RT718S1S"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="RT720S1S"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="RT722S1S"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="RT724S1S"
ENDIF

!9"ø
if B = 0'-9" AND H= 0'-9" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="RT908S1S"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="RT910S1S"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="RT912S1S"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="RT914S1S"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="RT916S1S"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="RT918S1S"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="RT920S1S"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="RT922S1S"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="RT924S1S"
ENDIF


!4X6
if B = 0'-3 1/2" AND H= 5 1/2" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T4608WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T4610WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T4612WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T4614WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T4616WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T4618WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T4620WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T4622WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T4624WP"
ENDIF

!4X8
if B = 0'-3 1/2" AND H= 7 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T4808WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T4810WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T4812WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T4814WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T4816WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T4818WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T4820WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T4822WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T4824WP"
ENDIF

!4X10
if B = 0'-3 1/2" AND H= 9 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T41008WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T41010WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T41012WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T41014WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T41016WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T41018WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T41020WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T41022WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T41024WP"
ENDIF

!2X6
if B > 1" and B < 2" and H = 0'-5 1/2" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T2608WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T2610WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T2612WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T2614WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T2616WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T2618WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T2620WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T2622WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T2624WP"
ENDIF

!2X8
if B > 1" and B < 2" and H = 0'-7 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T2808WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T2810WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T2812WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T2814WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T2816WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T2818WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T2820WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T2822WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T2824WP"
ENDIF

!2X10
if B > 1" and B < 2" and H = 0'-9 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T21008WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T21010WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T21012WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T21014WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T21016WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T21018WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T21020WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T21022WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T21024WP"
ENDIF

!2X12
if B > 1" and B < 2" and H = 0'-11 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T21208WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T21210WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T21212WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T21214WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T21216WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T21218WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T21220WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T21222WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T21224WP"
ENDIF

!6X8
if B = 5 1/2" AND H = 0'-7 1/4" THEN
if A >0'-0" and A <= 7'-0" then parameters HLH_Rafter_Code="T6808WP"
if A >7'-0" and A <= 9'-0" then parameters HLH_Rafter_Code="T6810WP"
if A >9'-0" and A <= 11'-0" then parameters HLH_Rafter_Code="T6812WP"
if A >11'-0" and A <= 13'-0" then parameters HLH_Rafter_Code="T6814WP"
if A >13'-0" and A <= 15'-0" then parameters HLH_Rafter_Code="T6816WP"
if A >15'-0" and A <= 17'-0" then parameters HLH_Rafter_Code="T6818WP"
if A >17'-0" and A <= 19'-0" then parameters HLH_Rafter_Code="T6820WP"
if A >19'-0" and A <= 21'-0" then parameters HLH_Rafter_Code="T6822WP"
if A >21'-0" and A <= 24'-0" then parameters HLH_Rafter_Code="T6824WP"
ENDIF

Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
2 REPLIES 2
Anonymous
Not applicable
You don't indicate how B and H are determined so it is impossible to say why that IF condition in not working. I suggest using a string type parameter with a values list to pick your rafter type so that the statement can read, for example:

IF rafter_type = "4x6" THEN

Conditions based on exact real number values can be tricky. It seems they can be undone by internal rounding errors. I have always tried to use greater than and less than to keep these reliable. For example, if I need to trap for 90 degrees (to avoid a divide by zero or some such) I would use:

IF angle > 89.99 & angle < 90.01 THEN

I started doing this when I found library parts which had worked in previous versions started to break in the new version of ArchiCAD at the time (AC6.0 if I recall correctly). I assume that it had to do with internal changes in the code or ways of handling precision and rounding errors. I also remember noticing that elements rotated or mirrored with the shift constrain would end up at 359.9997 degrees rather than zero.
Red
Advocate
I started doing this when I found library parts which had worked in previous versions started to break in the new version of ArchiCAD at the time (AC6.0 if I recall correctly).
Well this object is from good ol 6.5.
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz