MatrixFrame API
The MatrixFrame API can be used as a COM module via C #. Below are a number of ZIP files with examples with programming code for applying the API.
MatrixFrame version 5.6:
Microsoft Visual Studio 2019 project: MxAPITest560.zip
Example file from ZIP:
namespace Mx
{
public sealed class Frame
{
static private MxTSurrogate550Lib.MxFrame550 m_Frame = null;
public enum ETables
{
ET_NODALFORCES = 1,
ET_MEMBERFORCES = 1 << 2,
ET_DISPLDEFL = 1 << 3,
ET_SUPPORTREACTIONS = 1 << 4,
ET_FORCECUTS = 1 << 5,
ET_DISPLCUTS = 1 << 6,
ET_ENVELOPE = 1 << 7,
ET_POLYNOMS = 1 << 8,
ET_DEFAULT = ET_NODALFORCES | ET_MEMBERFORCES | ET_DISPLDEFL | ET_SUPPORTREACTIONS,
ET_FULL = 0xFFFF,
};
public static bool Create()
{
if (null == m_Frame)
m_Frame = new MxTSurrogate550Lib.MxFrame550();
return 0 != m_Frame.Create(0);
}
public static bool Destroy()
{
return 0 != m_Frame.Destroy();
}
public static bool Load(string path)
{
return 0 != m_Frame.Load(path);
}
public static bool LoadXML(string path)
{
return 0 != m_Frame.LoadXML(path);
}
public static bool Calculate(bool bAdvanced = false)
{
return 0 != m_Frame.Calculate(bAdvanced ? 1 : 0);
}
public static string ExportStructure(bool bToFile = true)
{
return m_Frame.ExportStructure(bToFile ? 1 : 0);
}
public static string ExportData(bool bToFile = true, ETables eTables = ETables.ET_DEFAULT)
{
return m_Frame.ExportData(bToFile ? 1 : 0, (int)eTables);
}
public static string ExportLog(string id, bool bToFile = true)
{
return m_Frame.ExportLog(id, bToFile ? 1 : 0);
}
public static bool SetSettings(string xmlSettings)
{
return 0 != m_Frame.SetSettings(xmlSettings);
}
public static bool SetLoadsGeneratorSettings(string xmlSettings)
{
return 0 != m_Frame.SetLoadsGeneratorSettings(xmlSettings);
}
public static bool RunLoadsGenerator()
{
return 0 != m_Frame.RunLoadsGenerator();
}
static public string ShowSectionDlg(string strSection)
{
return m_Frame.ShowSectionDlg(strSection);
}
enum SteelChecks // same as in Redist\Steel\SteCalc\SteEnums.h
{
Steel_None_Check = 0,
Steel_Cross_Check = (1 << 0),
Steel_LatBuckling_Check = (1 << 1),
Steel_Buckling_Check = (1 << 2),
Steel_Torsion_Check = (1 << 3),
Steel_Deflections_Check = (1 << 4),
Steel_Fire_Check = (1 << 5),
Steel_All_Buckling = (Steel_LatBuckling_Check | Steel_Buckling_Check),
Steel_All_Buckling_Cross = (Steel_All_Buckling | Steel_Cross_Check),
Steel_All_Buckling_Torsion = (Steel_All_Buckling | Steel_Torsion_Check),
Steel_All_Buckling_Cross_Torsion = (Steel_All_Buckling_Cross | Steel_Torsion_Check),
Steel_All_Check = (Steel_All_Buckling_Cross | Steel_Deflections_Check | Steel_Fire_Check),
};
public static string CalculateSteel(int nChecks = (int)SteelChecks.Steel_All_Check, bool bToFile = true)
{
return m_Frame.CalculateSteel(nChecks, bToFile ? 1 : 0);
}
enum TimberChecks // same as in Redist\FrameWork\FrameWork\Timber\TimberData.h
{
E_NO_CHECK = 1, ///< Check not defined
E_CROSS_CHECK = 2, ///< Cross check
E_LATERAL_BUCKLING_CHECK = 4, ///< Lateral buckling check
E_BUCKLING_CHECK = 8, ///< Buckling check
E_DEFLECTIONS_CHECK = 16, ///< Deflections check
E_FULL_CHECK = E_CROSS_CHECK | E_CROSS_CHECK | E_LATERAL_BUCKLING_CHECK | E_DEFLECTIONS_CHECK,
}
public static string CalculateTimber(int nChecks = (int)TimberChecks.E_FULL_CHECK, bool bToFile = true)
{
return m_Frame.CalculateTimber(nChecks, bToFile ? 1 : 0);
}
public static bool DongleIsModule(short nModule)
{
return 0 != m_Frame.DongleIsModule(nModule);
}
}
}