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

REF COMPONENT Property Script

Anonymous
Not applicable
I have built a part that comprises of several beam sizes. I am trying to write another script that references a component that I created in the database library. The name of the component is "4x6x8 Spruce Beam" The Key Code is "80000" and the component code is "X31040608" I already have the value that I want to multiply by so I don't need to add it to the script. According to the Archicad help this is what it looks like:

"REF COMPONENT code [, keycode [,
numeric_expression]]

Reference by code and keycode string to a component in an external database. The value to multiply by in the component database can be overwritten by the optional numeric expression specified here"


I have tried several different combinations with my numbers to get this script to work and can not figure out what I am doing wrong. See Below:

IF beam_size='4x6' THEN
IF a<8.00 THEN
REF COMPONENT X31040608 , 80000
ENDIF

Everytime I run a check script I get an error, the one above requests a string type expression.

Any help would be greatly appreciated. Thanks.

Barry Halloran
12 REPLIES 12
Anonymous
Not applicable
Karl,

After some work on it, I finally figured out that I had missed that endif statement. Thanks again for your help. Maybe once i get more advanced I will rewrite the script as you had previously suggested, it is very long but it works.


Barry
Anonymous
Not applicable
Karl,

Just an update to the script. I have evolved what you had shown me and added a few thinsg to it. By using if then statements I have made the part even more intuitive, I added calculations using gdl global parameters to the REF COMPONANT command. See Below:

IF joist_size="2x4 Blocking" THEN
REF COMPONENT "X40020416" , "200" , (((SYMB_A_SIZE*3.2808)/16)*1.10)
ENDI
F

The above script calculates the 2x4x16 Blocking the 1.10 is to add a 10% overage. Granted the script may not be efficient but it works. If I am able to figure out how to string script, I will go back and rewrite it. This command has made a HUGE difference in the way I will build parts for my Bill of Materials, I am able to take a lot of the responsibility off of the "Drafter" and put it in the program. Thanks again.

Barry
Karl Ottenstein
Moderator
Thanks, Barry. Glad I could help.

Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB