PolyFrame API is a fully programmable interface that lets you drive every aspect of PolyFrame without using the graphical user interface. You can:
- Define cross section, loads and supports programmatically
- Save and load project PolyFrame files in the native .pfr format
- Generate PDF reports automatically
- Extract analysis results for further processing in your own tools
By embedding the PolyFrame API into your workflow, you eliminate repetitive manual steps, accelerate project delivery and ensure consistent, error-free results through automation.
How to use PolyFrame API with C#
- Download & Install
Get the latest PolyFrame release from www.PolyStruc.com/Download and follow the installer prompts - Open Your IDE
Launch Visual Studio (or any C#-capable code editor) and load your project—or create a new one. - Add the PolyFrame.Connector Package
In the NuGet Package Manager, search for and install PolyFrame.Connector. - Create a Connection
In your code, instantiate the API connection: - Invoke API Commands
Call methods on yourconnectionobject to:- Define cross section, loads & supports
- Run analyses
- Save or load .pfr project files
- Generate PDF reports
- Extract results for further processing
using PolyFrame.Connector;
var polyFrame = new PolyFrameConnection()
Small Console Application Examples
Jumpstart your PolyFrame API integration with a suite of ready-to-run console apps. Simply download the examples, open the solution in Visual Studio, and run any project to see the API in action.
Example 1: Simple Steel Frame
Programmatically create a basic steel portal frame, retrieve its utilization ratio, and save the model as a .pfr file.
Example 2: Create PDFs for Saved Projects
Enter a directory path in the console; the app will scan for all .pfr files, open each one, and generate a corresponding PDF report.
Example 3: Open, Modify & Retrieve Model
Launch the PolyFrame GUI, design or edit a frame interactively, then pull that updated model back into your C# code for further automation.
Example 4: Create a Steel Truss Girder with Parametric Input
Use parametric inputs to define and generate a steel truss girder, then review the resulting geometry and model data in the PolyFrame UI.
Download the examples and explore what you can build with the PolyFrame API!