Insert Concrete Column Using VB.Net (Tekla Open Api)
This article explains how to insert a concrete column in a tekla model using open api in VB.Net
Contents
Step 1:
Add reference to the Tekla.Structures.Model.dll and the Tekla Structures.dll assemblies and manually start the application. This has been previous explained in the article below:
Step 2:
The code below will add a column to the model:
Sub main()
'hanlde to application
Dim appModel As Tekla.Structures.Model.Model
'column object
Dim objColumn As Tekla.Structures.Model.Beam
'start insertion point
Dim objStartPoint As Tekla.Structures.Geometry3d.Point
'end point of column
Dim objEndPoint As Tekla.Structures.Geometry3d.Point
'object initializers
appModel = New Tekla.Structures.Model.Model
objColumn = New Tekla.Structures.Model.Beam
objStartPoint = New Tekla.Structures.Geometry3d.Point(0, 0, 0)
'coordinates are in mm
objEndPoint = New Tekla.Structures.Geometry3d.Point(0, 0, 10000)
'the name of the column
objColumn.Name = "Column_1"
'the column section dimensions
objColumn.Profile.ProfileString = "800*800"
'the column material
objColumn.Material.MaterialString = "C25/30"
'the column start point
objColumn.StartPoint = objStartPoint
'the column end point
objColumn.EndPoint = objEndPoint
'inserts the column in the model
objColumn.Insert()
'applies the changes
appModel.CommitChanges()
End Sub
Code Explanation:
The lines below initialize Point objects. They determine the start and end locations of the column in mm coordinates:
objStartPoint = New Tekla.Structures.Geometry3d.Point(0, 0, 0)
'coordinates are in mm
objEndPoint = New Tekla.Structures.Geometry3d.Point(0, 0, 10000)
The ProfileString property determines the column sections dimensions:
objColumn.Profile.ProfileString = "800*800"
Note: For more complicated sections open the column property window and click on the select button next to the profile section:
From the dialog that opens you can select the profile you need:
You can then use the resulting profile string in your code:
The line below inserts the column in the model:
objColumn.Insert()
The changes will only be apparent after executing the line below. This is useful when you want to make multiple changes and apply them all at once:
appModel.CommitChanges()
You can download the file and code used in this project from the link below:
One thought on “Insert Concrete Column Using VB.Net (Tekla Open Api)”