Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

String Script in Rafter won't work

Anonymous
Not applicable
I have added a string script to a rafter so that I can extract an individual calculation based on the rafter drawn. I added a parameter that calulates the length of the rafter on the slope see below:

!----------------------------------------------------------
IF B=0.75" THEN
CodeStart = 'X40'
ENDIF
IF B=1.5" THEN
CodeStart = 'X40'
ELSE CodeStart = 'X31'


IF B=0.75" THEN
CodeMidA = '01'
ENDIF
IF B=1.5" THEN
CodeMidA = '02'
ENDIF
IF B=3.5" THEN
CodeMidA = '04'
ENDIF
IF B=5.5" THEN
CodeMidA = '06'
ENDIF
IF B=7.25" THEN
CodeMidA = '08'
ENDIF

IF H=0.75" THEN
CodeMidB = '01'
ENDIF
IF H=1.5" THEN
CodeMidB = '02'
ENDIF
IF H=3.5" THEN
CodeMidB = '04'
ENDIF
IF H=5.5" THEN
CodeMidB = '06'
ENDIF
IF H=7.25" THEN
CodeMidB = '08'
ENDIF
IF H=9.25" THEN
CodeMidB = '10'
ENDIF
IF H=11.25" THEN
CodeMidB = '12'
ENDIF
IF H=13.25" THEN
CodeMidB = '14'
ENDIF
IF H=15.25" THEN
CodeMidB = '16'
ENDIF

IF 'raf_len'>6'-0" AND 'raf_len'<=8'-0" THEN
CodeEnd = '08'
ENDIF
IF 'raf_len'>8'-0" AND 'raf_len'<=10'-0" THEN
CodeEnd = '10'
ENDIF
IF 'raf_len'>10'-0" AND 'raf_len'<=12'-0" THEN
CodeEnd = '12'
ENDIF
IF 'raf_len'>12'-0" AND 'raf_len'<=14'-0" THEN
CodeEnd = '14'
ENDIF
IF 'raf_len'>14'-0" AND 'raf_len'<=16'-0" THEN
CodeEnd = '16'
ENDIF
IF 'raf_len'>16'-0" AND 'raf_len'<=18'-0" THEN
CodeEnd = '18'
ENDIF
IF 'raf_len'>18'-0" AND 'raf_len'<=20'-0" THEN
CodeEnd = '20'
ENDIF
!----------------------------------------------------------
n=REQUEST ("name_of_listed", " ", objectname)

COMPONENT objectname, 1, 'pieces',1,Codestart + CodeMidA + CodeMidB + CodeEnd,'80000'

binaryprop


The COMPONENT command is and Incompatible type expression, (System Error -1)

Any Ideas? Thanks.

Barry Halloran
3 REPLIES 3
Rick Thompson
Expert
I don't think scripting should be necessary? Maybe I am missing something but I use the library Rafter2_1 and it gives slope length as is. The thing I didn't like about the return was that it was in exact lengths, which doesn't help for a material list... so, I had someone write a script that you put into the Roofmaker Library folder (in the property datafolder) that rounds them to the next higher 2' increment. I will email it to you if you like.
Rick Thompson
Mac Sonoma AC 26
http://www.thompsonplans.com
Mac M2 studio w/ display
Anonymous
Not applicable
Rick,

The reason for the script is for inventory purposes and quotes. The database parts are extracted to a third party program that then generates a cost and deducts the part from inventory. If you don't mind go ahead and email me the script I'll see if I can use any part of it. Thanks.

Barry Halloran
Rick Thompson
Expert
I'll paste it here so anyone searching later can see it.

!
! Property script for Lumber Pack calculation
! Parameters BxHxL
!
!print l
SQUOT="'"
DQUOTE='"'
TOL=0.0625 ! cut length tolerance is 1/16 in. 05/21 fl
MTI=1000/25.4 ! meter to inches
MTF=MTI/12 ! meter to feet
!
WI=B*MTI
HI=H*MTI
if (WI-INT(WI))>TOL THEN WI=INT(WI)+1 ! width is rounded up to nearest inch
if (HI-INT(HI))>TOL THEN HI=INT(HI)+1 ! height is rounded up to nearest inch
!++++
LINFT=L*MTF
LININ=LINFT-int(LINFT)
LINFT=int(LINFT)
if LININ>0.001 then LINFT=LINFT+1
if (LINFT-2*int(LINFT/2))>0.5 then LINFT=LINFT+1
!++++
BDFT=HI*WI*LINFT/12*QTY
WSTR=STR(WI,2,0)
HSTR=STR(HI,2,0)
LSTRF=STR(LINFT,2,0)
CUTSTR=WSTR+" x"+HSTR+" x "+LSTRF+SQUOT
COMPONENT "LUMBER OVERALL",BDFT,"Bdft",1,"01","80000"
COMPONENT CUTSTR,QTY,"ea.",1,CUTSTR,"80000"

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Rick Thompson
Mac Sonoma AC 26
http://www.thompsonplans.com
Mac M2 studio w/ display