CFS12 Automation Module
CFS12 Automation Module
Overview
CFS12 is a 32-bit class library which provides an API to the core CFS 12 calculation engine for performing
design calculations for cold-formed steel structural members. It is also available as a 64-bit library if
required for use in 64-bit applications.
System Requirements
• Windows 32/64-bit operating system
• .NET Framework 4.5
• Development environment supporting COM (i.e., Microsoft Excel VBA) or
.NET 4.5 (i.e., Microsoft Visual Studio)
• CFS 12 software installed and licensed. The CFS license may be a Single User License or a
Network License, but must include the automation option.
Installation
Run the installer program cfs12dllinst.exe with administrator permissions. This will step you through the
installation process. If you do not have the .NET Framework 4.5 installed, you will be prompted to
download and install it.
Licensing
The license to use the CFS12 module is bundled with a CFS license. When you purchase the license,
choose the Single User License with Automation or the Network License with Automation. Then use the
CFS software to activate the license.
COM Use
Development tools that support COM, such as Microsoft Excel VBA, can reference the CFS12 module.
To add a reference in Excel, open the Visual Basic editor and choose References from the Tools menu.
Then select the CFS12 Automation Module.
.NET Use
Development tools that support .NET 4.5, such as Microsoft Visual Studio 2010 or newer, can natively
reference the CFS12 assembly. To add a reference in Visual Studio, use the Browse feature from the
Add Reference window to select the assembly (i.e., C:\Program Files (x86)\RSG Software\CFS12 Module\
CFS12.dll).
1
Excel VBA Sample Code
Module1
Option Explicit
Public cfsCalc As CFS12.Calculation
TestError:
MsgBox Err.Source & " Error: " & Err.Description
End Sub
cfsCalc.LoadSection strFilename
Dim cfsProp As CFS12.SectionProperties
Set cfsProp = cfsCalc.GrossProperties()
GrossArea = cfsProp.Area
End Function
ThisWorkbook
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Release network license before the workbook closes
If Not (Module1.cfsCalc Is Nothing) Then cfsCalc.ReleaseLicense
End Sub
2
VB.NET Sample Code
Module1.vb
Imports RSG.CFS12
Module Module1
Public cfsCalc As Calculation
cfsCalc.LoadSection("C:\CFS Files\Test.cfss")
Dim cfsProp As SectionProperties = cfsCalc.GrossProperties()
Debug.Print("Gross Area=" & cfsProp.Area)
End Module
ApplicationEvents.vb
Namespace My
Partial Friend Class MyApplication
Private Sub MyApplication_Shutdown(sender As Object, e As EventArgs) _
Handles Me.Shutdown
'Release network license before the application closes
If Module1.cfsCalc IsNot Nothing Then Module1.cfsCalc.ReleaseLicense()
End Sub
End Class
End Namespace
3
API Documentation
Namespace: RSG.CFS12
Calculation Class
Initialization Methods and Properties
Sub DefineSection(SctData As SectionData)
SctData: Section data object which defines the type of section, dimensions, and material
properties
Filename: Name of a CFS section file (*.sct or *.cfss) or the name of a section in a CFS
section library (*.scl or *.cfsl). Example: CFS Files\SSMA.cfsl|U-Channels\250U050-54.cfss
Fy: Optional. Yield stress override (ksi). If omitted, the yield stress stored in the section file
will be used.
Fu: Optional. Tensile strength override (ksi). If omitted, the tensile strength stored in the
section file will be used. If Fy is provided but Fu is omitted, Fu will be set to Fy.
Reserve: Apply inelastic reserve strength increase. Default value is False. If set to True, cold-
work of forming will not be applied.
Property HasLicense
Indicates if the instance of the Calculation class was successfully initialized with a license,
and the license is still active – not released or dropped. Read only.
Sub ReleaseLicense()
To be called when done with the Calculation class so the license is immediately freed up.
This is important for network license usage. If other instances of the Calculation class are
still active, the license will not be released until all instances have released the license.
Calculation Methods
Function SectionData() As SectionData
Collects section information and interprets geometry for the current CFS section
Calculates the gross section properties for the current CFS section
4
Function NetProperties() As SectionProperties
Calculates the net section properties for the current CFS section
Calculates the effective section properties for the current CFS section
Calculates the fully braced strength for the current CFS section
FixCG: Option to prevent axial eccentricities caused by a shift in the effective section
centroid under axial compression. Default value is False.
5
SectionData Class
Properties
ColdWork: Apply strength increase from cold-work of forming (Boolean)
Flange: Flange width (in), negative return value indicates flange width varies
Lip: Lip length (in), negative return value indicates lip length varies
LipAngle: Angle of lip (radians), negative return value indicates lip angle varies
Radius: Inside bend radius (in), negative return value indicates radius varies
Thickness: Thickness of section parts (in), negative return value indicates thickness varies
WebAngle: Angle of web (radians), negative return value indicates web angle varies
SectionProperties Class
ReadOnly Properties
Alpha: Angle of the major axis from the horizontal X axis, CCW positive (radians)
6
Ic: Polar moment of inertia about centroid (in4)
SectionForces Class
Properties
B: Torsion bimoment (k-in²). For a C section with a vertical web, a positive bimoment causes
compression in upper-left and lower-right quadrants of the section.
Dx: Horizontal deflection (in), use 0 to skip the deflection check and improve performance
Dy: Vertical deflection (in), use 0 to skip the deflection check and improve performance
7
My: Moment about Y axis (k-in), compression on right is positive
SectionStrength Class
ReadOnly Properties
Ae: Effective area at nominal compressive strength (in²)
Sxben: Effective section modulus for bottom fiber at negative Mnx (in³)
Sxbep: Effective section modulus for bottom fiber at positive Mnx (in³)
Sxten: Effective section modulus for top fiber at negative Mnx (in³)
Sxtep: Effective section modulus for top fiber at positive Mnx (in³)
Sylen: Effective section modulus for left fiber at negative Mny (in³)
Sylep: Effective section modulus for left fiber at positive Mny (in³)
Syren: Effective section modulus for right fiber at negative Mny (in³)
Syrep: Effective section modulus for right fiber at positive Mny (in³)
8
Vy: Vertical shear strength (k)
MemberParams Class
Properties
BracedFlange: Braced flange (see Flange options)
MxMax: Maximum moment about X axis (k-in), used to adjust vertical deflection
MyMax: Maximum moment about Y axis (k-in), used to adjust horizontal deflection
Pdelta: Indicates whether applied moments include P-δ effects, default is False
Spec: Specification to use for the member check (see Specification options)
MemberUnityCheck Class
ReadOnly Properties
B: Torsion bimoment strength (k-in²)
9
Dx: Unity check for horizontal deflection
WebParams Class
Properties
Dir: Load direction (1=vertical, 2=horizontal)
Lload: Distance from edge of load to edge of opposite load (in), use large value if no opposing
concentrated load
P: Concentrated load or reaction (k), positive load is on bottom flange (or left flange for
horizontal load)
Spec: Specification to use for the web check (see Specification options)
WebUnityCheck Class
ReadOnly Properties
Flags: Combined flags indicating strength calculation notes (see NoteFlags)
10
PM: Unity check for combined bending/web-crippling
SectionType Enum
Constants
Unknown = 0 (returned if loaded section does not match one of the other profiles)
Cee = 1
CeeStiffened = 2
Zee = 3
ZeeStiffened = 4
DoubleCee = 5
DoubleCeeStiffened = 6
Box = 7
Tube = 8
Angle = 9
AngleStiffened = 10
Hat = 11
Cylinder = 12
Specification Enum
Constants
AISI1999USASD = 0
AISI1999USLRFD = 1
AISI2001USASD = 2
AISI2001USLRFD = 3
AISI2001MexASD = 4
AISI2001MexLRFD = 5
AISI2001CanLSD = 6
AISI2004USASD = 7
AISI2004USLRFD = 8
AISI2004MexASD = 9
AISI2004MexLRFD = 10
AISI2004CanLSD = 11
AISI2007USASD = 12
AISI2007USLRFD = 13
AISI2007MexASD = 14
AISI2007MexLRFD = 15
AISI2007CanLSD = 16
AISI2010USASD = 17
AISI2010USLRFD = 18
AISI2010MexASD = 19
AISI2010MexLRFD = 20
AISI2010CanLSD = 21
AISI2012USASD = 22
AISI2012USLRFD = 23
AISI2012MexASD = 24
11
AISI2012MexLRFD = 25
AISI2012CanLSD = 26
AISI2016USASD = 27
AISI2016USLRFD = 28
AISI2016MexASD = 29
AISI2016MexLRFD = 30
AISI2016CanLSD = 31
AISI2018USASD = 32
AISI2018USLRFD = 33
AISI2018MexASD = 34
AISI2018MexLRFD = 35
AISI2018CanLSD = 36
Flange Enum
Constants
None = 0
Bottom = 1
Top = 2
Left = 3
Right = 4
CalculationException
Messages
No license found
License was released
License check failed
Error loading section: …
Geometry error: …
Properties error: …
No section has been loaded or defined yet
Section has no DSM data
Invalid section definition
Invalid yield stress
Invalid tensile strength
Invalid thickness
Invalid radius
Invalid section depth
Invalid flange width
Invalid lip length
Invalid web angle
Invalid lip angle
Invalid section type
Invalid connector spacing
Invalid hole length
Invalid hole spacing
Invalid specification
12
Invalid unbraced length
Invalid effective length factor
Invalid braced flange
Invalid moment reduction factor
Cannot apply one-flange bracing to a fully braced member
Invalid value for Cb
Invalid value for Cm
Invalid value for maximum deflection
Invalid load direction
Invalid bearing length
NoteFlags Enum
Constants (additive)
ThinTubeWall = 1: D/t exceeds maximum for cylindrical tube
SlenderElement = 2: w/t exceeds maximum for an element
LongEdgeStiffener = 4: D/w or do/bo exceeds maximum for an edge stiffener
EdgeStiffenerAngle = 8: Edge stiffener angle outside limits
SlenderColumn = 16: KL/r exceeds maximum for a column member
SheathedColumnLimits = 32: Section does not meet all req’s for sheathed column provisions
SheathedColumnFastener = 64: Sheathed column fastener assumed to be at middle of flange
ConnectorSpacing = 128: a/ri exceeds 0.5KL/r
BendRadius = 256: R/t exceeds limit
HoleDepthRatio = 512: dh/h exceeds limit
HoleDepth = 1024: Hole depth exceeds limit
HoleLength = 2048: Hole length exceeds limit
HoleSpacing = 4096: Clear distance between holes less than limit
YieldStress = 8192: Yield stress exceeds Specification limit
TorsionCheck = 16384: Unable to check torsion with overridden Cw
13
Appendix 1 – Changes from CFS11
The CFS12 module has implemented the following interface changes over the CFS11 module:
MemberUnityCheck Class: Added B property for torsion bimoment strength, and BMxMy
property for combined torsion/bending unity check.
Multiple simultaneous instances of the Calculation object are supported by retaining the license
until all instances have released the license or have been disposed.
14