Get started with the Tekla PowerFab Open API
In this guide you will go through how to get started with the Tekla PowerFab Open API.
What’s possible with the Tekla PowerFab Open API
Watch the short video below to learn how to use the Tekla PowerFab Open API on both the Tekla PowerFab Go web product and the Tekla PowerFab Office desktop product.
You will see how to code an application that uses the drawing management functionality and how the changes get updated to both web and desktop products.
How the Tekla PowerFab Open API works
The Tekla PowerFab Open API provides a data-access layer to the Tekla PowerFab database. The .NET classes model the XSD request and response schemas' structure and content. As a developer it is easiest to code directly with the .NET classes and data types described in the API Reference.
Prerequisites
In order to develop on top of the Tekla PowerFab Open API you need to purchase a Tekla PowerFab license, or join the Tekla Partners Program.
By joining the Tekla Partners Program you will be able to purchase Tekla Partners Program Suite containing the Tekla PowerFab product, along with other Tekla products.
Not a member of the Tekla Partners Program yet?
Get familiar with the benefits and apply to the Tekla Partners Program.
Prepare your setup
-
To get started you will need to create an empty .NET application project in Microsoft Visual Studio. Follow the steps in this guide: Create a new project in Microsoft Visual Studio.
-
Next, add reference to the Tekla PowerFab Open API dll package. The package file is called Tekla.PowerFab.API.dll and can be added from NuGet.
-
From the Project menu in Microsoft Visual Studio select Manage NuGet packages.
-
Select Browse and search for PowerFab.
-
Select Tekla.PowerFab.API then click Install.
-
-
Then, download and add fabsuite-xml-request-v0108.cs source file to your Microsoft Visual Studio project.
-
Download the source file here.
-
On the Project menu of Microsoft Visual Studio, click Add existing item.
-
Browse to fabsuite-xml-request-v0108.Designer.cs and click Add.
-
-
Then, download and add fabsuite-xml-response-v0108.cs source file to your Microsoft Visual Studio project.
-
Download the source file here.
-
On the Project menu of Microsoft Visual Studio, click Add existing item.
-
Browse to fabsuite-xml-response-v0108.cs and click Add.
-
The Tekla PowerFab API schema is updated often. Updated Request and Response xsd files are installed with Tekla PowerFab in the Docs folder of the program installation directory. To convert these to .cs:
1. Open a Visual Studio Developer Command Prompt
- From Visual Studio: Tools->Command Line->Developer Command Prompt
- From Start Menu: Visual Studio -> Developer Command Prompt
3. type the following:
xsd /classes [xsd filename]
Continue coding by editing an existing code example
Here's a simple Tekla PowerFab API code example.
The code example will show, for example:
- how to connect and disconnect the Tekla PowerFab database
- how to read the Production Control jobs
- how to show each job in a list box