This action might not be possible to undo. Are you sure you want to continue?
EXCEL SHEET DESIGN INCORPORATION WITH TEKLA STRUCTURES 1. Background
This document gives instructions how to link your own Excel sheet calculations to Tekla Structures. It is expected that you have Excel calculation sheet ready. 2. 2.1 Custom component Create custom component
Create a custom component in Tekla Structures (version 11.1 ->) which relates to similar situation as your Excel calculation sheet. In this example we will calculate in-situ beam to beam reinforcement. So first create custom component for this situation. Name the component according to the purpose, in this situation beamtobeam.
Edit custom component
Edit the custom component as you usually would. Add the magnetic user planes to workpoints of the reinforcements and bind the planes to part faces, so the reinforcement reacts to change of the profile size.
2 (20) B&C Services / Tero Kautto 6.9.2005
Next add a new parameter and name it "use_externaldesign", change the value type to Yes/No and define formula 1 (1=Yes 0=No).
Then add other parameters you need for this component and for the calculations. Name parameters according to their purpose and then link the parameters to necessary places in component browser. In this example: • Reinforcing bar diameter • Number of reinforcing bars • Cover thickness on plane • Cover thickness from plane • Shear force
2 Creation of Excel calculation sheet Make a copy of component_template.1\nt\bin\plugins) Const DEBUG As Boolean = True'False Const SHOW_EXCEL As Boolean = True'False 3.xls (C:\TeklaStructures\11.2005 Shear force is only used for calculation. in this example: component_ beamtobeam. 3.3 (20) B&C Services / Tero Kautto 6.9.vb (C:\TeklaStructures\11.1 Excel sheet Preparations In order to test and see how the Excel sheet functions make the following changes to Excel. Save the component and test that it works as expected.1\environments\countryindependent\Exceldesign) to same folder. 3. so it isn't linked component browser. Rename the copy to "component_(your component name). Open your calculation sheet and component_*.xls.xls sheet in Excel at the same time. (You can place Excel sheet under model folder as well. Create folder called Exceldesign for this purpose).xls". . Copy the calculation sheet to component Excel by right clicking on top of sheet name -> Move or Copy.
2005 Select the component_*.4 (20) B&C Services / Tero Kautto 6.xls (component_beamtobeam. .9. Click OK. this copies the calculation sheet to component Excel.xls) from the "To book:" drop down and check "create a copy".
5 (20) B&C Services / Tero Kautto 6.xls) to calculation.9. .2005 Close the old calculation sheet.xls (component_beamtobeam. Rename (right click -> rename) the copied sheet (sheet1) on component_*.
So I changed Excel sheet so that instead of calculation the ratio of given number of reinforcing bars.9. it now calculates the ratio of single rebar and if anchoring capacity isn't enough it adds another rebar and calculates ratio again and keeps on doing this until there is enough reinforcing bars to hold the shear force. . For instance in this case the original calculation defined on given values whether reinforcement ratio is under or above 1.2005 Quite often you might need (or want) the Excel calculation sheet to work differently with Tekla Structures as a stand alone Excel sheet.3 Editing the component calculation sheet 6.6 (20) B&C Services / Tero Kautto 3. When the calculations are connected to Tekla Structures it might be wise to edit the calculations so that it would then calculate the required reinforcement and pass the information back to component for execution.
add the variables that you want to output back to component to Outputs sheet. In this example we only calculate number of required reinforcing bars.g.7 (20) B&C Services / Tero Kautto 3. (parameter name and type. e.2005 Go to Inputs sheet and add the parameters which are required for the calculations from component. string.4 Adding input and output fields 6.inp file with text editor). . On system components "Save as" is the best way.9. so only parameter outputted is number of reinforcing bars (parameter = Barnumber1) Tip: You can check attribute names as well from component properties file (Save as on component dialog or open component. int etc) Similar way.
2005 Linking input.8 (20) B&C Services / Tero Kautto 3. go to component page and select the main part width field. Value linked to calculation page Example 2: Link main beam width value from component page to calculations page.5 6. click enter. Click shear force value field on calculations page and make equal mark (=). Create = to value field . 1. create equal mark (=) to Width of main beam B value.9. which then brings the new values to component and updates it. output and component fields to calculations When ever component is modified the calculation needs to be rerun. we need to link the input and necessary component fields to calculation sheet. Select shearforce field on Inputs page 3. Same way as on example 1. In order this to happen automatically. Create = to value field 2. Example 1: Link the shear force value from Inputs page to calculation page. then go to Inputs page and select Value field for shear force and click enter. and from calculation sheet to Output sheet. 1.
9 (20) B&C Services / Tero Kautto 6. 3. Value linked to calculation page .2005 2. Select Width of Primary profile field on Component page (the value from model is brought here when component is created/modified.9.
. Example 5: Finally you need to link the calculation results to Output page.10 (20) B&C Services / Tero Kautto 6. Create = to value field 2.9. Example 4: Link all the necessary fields from Inputs and Components pages to Calculation page. Select the final number of reinforcing bars field.2005 Example 3: In similar fashion you can link for instance Component ID from component page to Calculation page. 1.
Test the incorporation of Excel sheet and Component Fill in values to component dialog.6 Test Excel sheet After linking all the necessary fields. Save and close Excel. Note that you have to leave the fields that are brought back from calculations to component empty. Check also that calculation results are transferred to Output page.2005 3. Give or change values on Inputs page (and/or component page).9. the default value is send to Excel. . 4.11 (20) B&C Services / Tero Kautto 6. Value linked to Outputs page 3. and check that values are transferred correctly to calculations page and calculations are performed correctly. test the functionality.
Click OK to continue.2005 Hit modify. After the values have been set a small dialog opens telling you that. You will get another small dialog telling you that component data has been set. Compiler service will start in separate dos window.9. Input values are set. . Normally Excel is used without showing it to user (behind the scenes).12 (20) B&C Services / Tero Kautto 6. but now we have debug option on and after a few seconds Excel sheet will appear with input values from component dialog. Hit OK to continue Next you will see all the values on component page update.
2005 Click OK. Congratulations! You have created Excel calculation for custom component. number of reinforcement bars can be calculated in Excel sheet as well. After Excel has gone through the calculation the values are transferred to component and the component is updated. in case you are working with custom component.13 (20) B&C Services / Tero Kautto Next the Output values will been set. there must be default value calculation in Excel sheet. It is important that all these calculated values are passed back to component on output page.9. Note: Because calculation requires as well some value for parameter. . E. Note: Excel can loop a few times. which are just defaults on dialog/input page. 6.g. This ensures that parameters used on calculations are the same which appear on the model.
As an example below are instructions how to create a function that saves the results either in htm or xls format. Create field for results folder as: =C9 & "\" & "ExcelDesignResults" (C9= definition for model folder) To get the file path and id also to saved calculation page. With this parameter you can indicate to user if connection design did pass or fail. Lets add there definition for results folder.htm" (F10 = earlier defined result folder) .2005 Tip: Error code: You can add as well parameter called ‘Error’ to output page. =Component!F10 & "\" & ComponentID & ". You can use values: 1=green component symbol.9. 5.14 (20) B&C Services / Tero Kautto 6. 2=yellow component symbol or 3=red component symbol.1 Defining result file and path Field "ModelDirectory" on Component page will be automatically updated depending on location of component. Let use model folder as bases for results folder. define similar cell to that page also. Saving results and other editing There are a lot of nice features you can add Excel sheet. 5.
.15 (20) B&C Services / Tero Kautto 5.g. • • • • • • Define Macro name Click OK to start recording.2005 Next we will create Excel Macro that publishes document as htm format. so we need to edit the macro. which always publishes calculation page. ExcelDesignResults folder • • Click Publish Stop recording This records a macro. then: File -> Save as Web Page Click Publish Select Item on Calculation – Sheet "All contents of Calculations" Change the file name to Publish the results in model folder e. • Go to Tools -> Macro -> Macros… • Select SaveResults • Click Edit – opens the Visual Basic editor . which always uses the same file name and the same destination folder.9. But this is still a "dumb" macro. Start Excel macro recording Tools –> Macro -> Record New Macro.2 Recording and editing an Excel macro 6..
9.CreateFolder (report_folder) End If Note that F10 should point to predefined cell on Component page that defines the results folder.FolderExists(report_folder) If new_folder = 0 Then fs. .2005 Let's first add a script that automatically creates the results folder under model folder (if necessary).16 (20) B&C Services / Tero Kautto 6.Value Set fs = CreateObject("Scripting.Range("F10"). ' Save Results Sheet report_folder = Worksheets("component").FileSystemObject") new_folder = fs.
If Names("SaveReport").Select report_path = report_folder & "\" & Worksheets("component").Value & ".9.RefersToRange.Range("C2").17 (20) B&C Services / Tero Kautto 6. If you select field F9 on component page.Value = "HTML" Then Sheets("Calculation").htm" . Add following script to Excel code – so if the value on "SaveReport" cell is HTML then file is saved with component id number and htm extension.2005 Next we will add a script which defines whether the file is saved in htm or xls format. you will notice that field is also named SaveReport.
"".mht". "component_beamtobeam_10588".Value = "WorkBook" Then 'Save Workbook ActiveWorkbook.Publish (False) .2005 Since we have now added a few lines to code which tells where to save the results and the name of the file to be saved.Filename = _ report_path . ElseIf Names("SaveReport"). xlHtmlStatic. we need to edit the original code little bit.AutoRepublish = False End With ChDir "C:\TeklaStructuresModels111\Excel_test\ExcelDesignResults" To: With ActiveWorkbook.PublishObjects.9. _ "Calculation". We still need to define the option to save the file in xls format.xls" End If .Add(xlSourceSheet.Range("C2").PublishObjects("component_beamtobeam_10588") . So add following script to Excel code – if the value on "SaveReport" cell is WorkBook then file is saved with component id number and xls extension.AutoRepublish = False End With So just copy/paste the "component_name_number" value from original code to new code (in this example: "component_beamtobeam_10588").Value & ".Publish (True) .18 (20) B&C Services / Tero Kautto 6. Change code from: With ActiveWorkbook.HtmlType = xlHtmlStatic . "") . _ "C:\TeklaStructuresModels111\Excel_test\ExcelDesignResults\Page.SaveAs Filename:=report_folder & "\" & Worksheets("component").RefersToRange.
• Go to Tools -> Macro -> Macros… • Select StartCalculation • Click Edit Add a call for SaveResults macro Call SaveResults Save changes and close debugger. Let's test the macro: • Go to Tools -> Macro -> Macros… • Select SaveResults • Run Check that macro created the wanted folder underneath model folder and creates htm file in that folder. .19 (20) B&C Services / Tero Kautto Save changes and close debugger. • Check also that content in htm file is correct.9. Test component • Delete the ExcelDesignResults folder from model folder • Modify the component in Tekla Structures – it should now automatically add the folder and the result file.2005 To make the SaveResults macro run automatically each time component is modified we still need to add a call function for it. 6.
vb back to original state.2005 6.20 (20) B&C Services / Tero Kautto 6. (C:\TeklaStructures\11. Finalizing the creation of the component Change the Excel calculations to work behind the scenes again.9.1\nt\bin\plugins) Const DEBUG As Boolean = False'True Const SHOW_EXCEL As Boolean = False'True Test the component again – calculation should work and results should be saved as before. Change the Excel. . but Excel calculation shouldn't pop up.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.