mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-19 10:45:56 +00:00
copied Revit 2024 SDK
This commit is contained in:
@@ -0,0 +1,321 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2015 Autodesk, Inc. All rights reserved.
|
||||
//
|
||||
// Use of this software is subject to the terms of the Autodesk license
|
||||
// agreement provided at the time of installation or download, or which
|
||||
// otherwise accompanies this software in either electronic or hard copy form.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using AstSTEELAUTOMATIONLib;
|
||||
using JointDesignUtils;
|
||||
|
||||
|
||||
namespace SampleDesign
|
||||
{
|
||||
[ComVisible(true)]
|
||||
[Guid("C64ECF63-D01C-451F-B0E0-E3F85DFAC05E")]
|
||||
|
||||
public class CreatePlateDesign : INodeStressAppModule
|
||||
{
|
||||
#region Private_Members
|
||||
private StressModuleJoint m_joint;
|
||||
|
||||
private Torsors m_pTorsorsPage;
|
||||
private SimpleTorsors m_SimpleTorsorsPage;
|
||||
private Settings m_SettingsPage;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Standard_Methods
|
||||
|
||||
public eJointStatus CheckJoint()
|
||||
{
|
||||
eJointStatus ret = eJointStatus.JointSupported;
|
||||
|
||||
//report format
|
||||
int nReportFormat = (int)getJointNSAModuleSpecificData(m_joint, this, "ReportFormat", 0);
|
||||
|
||||
//get efforts
|
||||
List<double> dM, dN, dV;
|
||||
List<string> sCaseName;
|
||||
getEfforts(m_joint, m_joint.GetJointNSAModuleLoadingCases(this), m_joint.UseDetailedTorsors, out dM, out dN, out dV, out sCaseName);
|
||||
|
||||
|
||||
//read some values from joint
|
||||
bool bModifiable = false;
|
||||
double dPlateThickness = (double)m_joint.GetJointParam("PlateThickness", ref bModifiable);
|
||||
double dPlateLength = (double)m_joint.GetJointParam("PlateLength", ref bModifiable);
|
||||
double dPlateWidth = (double)m_joint.GetJointParam("PlateWidth", ref bModifiable);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool DesignEngineAvailable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public eJointStatus ExportJoint()
|
||||
{
|
||||
return eJointStatus.JointUnknownStatus;
|
||||
}
|
||||
|
||||
public void FreeUserPages()
|
||||
{
|
||||
if (m_pTorsorsPage != null)
|
||||
{
|
||||
m_pTorsorsPage.Dispose();
|
||||
m_pTorsorsPage = null;
|
||||
}
|
||||
if (m_SettingsPage != null)
|
||||
{
|
||||
m_SettingsPage.Dispose();
|
||||
m_SettingsPage = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void FreeUserTorsorsPage()
|
||||
{
|
||||
if (m_SimpleTorsorsPage != null)
|
||||
{
|
||||
m_SimpleTorsorsPage.Dispose();
|
||||
m_SimpleTorsorsPage = null;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetExportName()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public bool GetFeatureName(ref string FeatureName)
|
||||
{
|
||||
FeatureName = "JOINT_DESIGN_EC3";
|
||||
return true;
|
||||
}
|
||||
|
||||
public string GetImportName()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public string GetLastReportFilename(bool bQuickReportFilename)
|
||||
{
|
||||
if (bQuickReportFilename)
|
||||
return m_joint.GetModuleOutputFileName(this) + ".txt";
|
||||
else
|
||||
return m_joint.GetModuleOutputFileName(this) + ".html";
|
||||
}
|
||||
|
||||
public void GetProcessingModes(out bool bCheckAvailable, out bool bPresizeAvailable, out bool bImportAvailable, out bool bExportAvailable, out bool bUseLoadCasesAvailable)
|
||||
{
|
||||
bCheckAvailable = true;
|
||||
bPresizeAvailable = false;
|
||||
bImportAvailable = false;
|
||||
bExportAvailable = false;
|
||||
bUseLoadCasesAvailable = true;
|
||||
}
|
||||
|
||||
public void GetUserPages(RulePageArray pagesRet, PropertySheetData pPropSheetData)
|
||||
{
|
||||
m_pTorsorsPage = new Torsors();
|
||||
m_pTorsorsPage.setJoint(this);
|
||||
|
||||
RulePage pgTorsors = m_joint.CreateRulePage();
|
||||
pgTorsors.title = 88136;
|
||||
pgTorsors.hWnd = (int)m_pTorsorsPage.Handle;
|
||||
pagesRet.Add(pgTorsors);
|
||||
}
|
||||
|
||||
public void GetUserSettingsPages(RulePageArray pagesSettingsRet, PropertySheetData pPropSheetData)
|
||||
{
|
||||
pPropSheetData.SheetPrompt = 88140;
|
||||
|
||||
m_SettingsPage = new Settings();
|
||||
m_SettingsPage.setJoint(this);
|
||||
|
||||
RulePage pgSettings = m_joint.CreateRulePage();
|
||||
pgSettings.title = 88140;
|
||||
pgSettings.hWnd = (int)m_SettingsPage.Handle;
|
||||
pagesSettingsRet.Add(pgSettings);
|
||||
}
|
||||
|
||||
public void GetUserTorsorsPage(RulePage pageRet)
|
||||
{
|
||||
m_SimpleTorsorsPage = new SimpleTorsors();
|
||||
m_SimpleTorsorsPage.setJoint(this);
|
||||
pageRet.hWnd = (int)m_SimpleTorsorsPage.Handle;
|
||||
}
|
||||
|
||||
public eJointStatus ImportJoint()
|
||||
{
|
||||
return eJointStatus.JointUnknownStatus;
|
||||
}
|
||||
|
||||
public void InvalidFeature(int reserved)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public StressModuleJoint Joint
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_joint;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_joint = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string ModuleName
|
||||
{
|
||||
get { return "EC3 Design"; }
|
||||
}
|
||||
|
||||
public eJointStatus PresizeJoint()
|
||||
{
|
||||
return eJointStatus.JointUnknownStatus;
|
||||
}
|
||||
|
||||
public string Standard
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Standard";
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private_Methods
|
||||
|
||||
private object getJointNSAModuleSpecificData(StressModuleJoint pCurJoint, INodeStressAppModule NSAModule, string sKey, object defaultValue)
|
||||
{
|
||||
object param = defaultValue;
|
||||
|
||||
try
|
||||
{
|
||||
param = pCurJoint.GetJointNSAModuleSpecificData(NSAModule, sKey);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Write(e.Message);
|
||||
try
|
||||
{
|
||||
pCurJoint.SetJointNSAModuleSpecificData(NSAModule, defaultValue, sKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Write(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
private void getEfforts(StressModuleJoint pCurJoint, IJointLoadingCases spJointLoadingCases, bool bUseDetailedTorsors,
|
||||
out List<double> dfEffM, out List<double> dfEffN, out List<double> dfEffV, out List<string> sCaseName)
|
||||
{
|
||||
|
||||
dfEffM = new List<double>();
|
||||
dfEffN = new List<double>();
|
||||
dfEffV = new List<double>();
|
||||
sCaseName = new List<string>();
|
||||
|
||||
//get the efforts from SIMPLE TORSORS
|
||||
try
|
||||
{
|
||||
if (null != spJointLoadingCases && false == bUseDetailedTorsors)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if (null != spJointEfforts && spJointLoadingCase.Name == "SimpleMaxTorsor")
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
sCaseName.Add(spJointLoadingCase.Name);
|
||||
dfEffM.Add((double)spJointEfforts[0].Value);
|
||||
dfEffN.Add((double)spJointEfforts[1].Value);
|
||||
dfEffV.Add((double)spJointEfforts[2].Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.Write(e);
|
||||
}
|
||||
|
||||
|
||||
//get the efforts from DETAILED TORSORS
|
||||
try
|
||||
{
|
||||
char[] splitChars = new char[2];
|
||||
splitChars[0] = '#';
|
||||
splitChars[1] = '@';
|
||||
|
||||
if (bUseDetailedTorsors)
|
||||
{
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if (null != spJointEfforts && spJointLoadingCase.Name != "SimpleMaxTorsor")
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
string[] sSplitName = spJointLoadingCase.Name.Split(splitChars);
|
||||
sCaseName.Add(sSplitName[sSplitName.Length - 1]);
|
||||
dfEffM.Add((double)spJointEfforts[0].Value);
|
||||
dfEffN.Add((double)spJointEfforts[1].Value);
|
||||
dfEffV.Add((double)spJointEfforts[2].Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.Write(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeDesignModuleData()
|
||||
{
|
||||
if (m_joint == null)
|
||||
return;
|
||||
|
||||
Utils.InitializeEC3JointDesignData(m_joint, this);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SampleDesign")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk")]
|
||||
[assembly: AssemblyProduct("SampleDesign")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("71b9c5c2-f638-42a2-b13b-10bdfac16f7d")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\StructuralConnectionsSDKSamples.Common.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
|
||||
<ProjectGuid>{9CE75523-141E-4F65-8F96-71E2A9C826E2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SampleDesign</RootNamespace>
|
||||
<AssemblyName>SampleDesign</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Binaries\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Binaries\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AxInterop.ASTCONTROLSLib">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(ASInstallDir)\AxInterop.ASTCONTROLSLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="DotNetRoots">
|
||||
<HintPath>$(ASInstallDir)\DotNetRoots.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Interop.ASTCONTROLSLib">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(ASInstallDir)\Interop.ASTCONTROLSLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Interop.AstSTEELAUTOMATIONLib5">
|
||||
<HintPath>$(ASInstallDir)\Interop.AstSTEELAUTOMATIONLib5.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Interop.DSCGEOMCOMLib">
|
||||
<HintPath>$(ASInstallDir)\Interop.DSCGEOMCOMLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Interop.DSCODBCCOMLib">
|
||||
<HintPath>$(ASInstallDir)\Interop.DSCODBCCOMLib.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Interop.DSCRootsCOMLib">
|
||||
<HintPath>$(ASInstallDir)\Interop.DSCRootsCOMLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="DotNetRoots">
|
||||
<HintPath>$(ASInstallDir)\JointDesignUtils.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="JointDesignUtils">
|
||||
<HintPath>$(ASInstallDir)\JointDesignUtils.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CreatePlateDesign.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Settings.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Settings.Designer.cs">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SimpleTorsors.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimpleTorsors.Designer.cs">
|
||||
<DependentUpon>SimpleTorsors.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Torsors.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Torsors.Designer.cs">
|
||||
<DependentUpon>Torsors.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Settings.resx">
|
||||
<DependentUpon>Settings.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SimpleTorsors.resx">
|
||||
<DependentUpon>SimpleTorsors.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Torsors.resx">
|
||||
<DependentUpon>Torsors.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,91 @@
|
||||
namespace SampleDesign
|
||||
{
|
||||
partial class Settings
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.gbReport = new System.Windows.Forms.GroupBox();
|
||||
this.lbReportFormat = new System.Windows.Forms.Label();
|
||||
this.cbReportFormat = new System.Windows.Forms.ComboBox();
|
||||
this.gbReport.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// gbReport
|
||||
//
|
||||
this.gbReport.Controls.Add(this.lbReportFormat);
|
||||
this.gbReport.Controls.Add(this.cbReportFormat);
|
||||
this.gbReport.Location = new System.Drawing.Point(3, 3);
|
||||
this.gbReport.Name = "gbReport";
|
||||
this.gbReport.Size = new System.Drawing.Size(325, 58);
|
||||
this.gbReport.TabIndex = 13;
|
||||
this.gbReport.TabStop = false;
|
||||
this.gbReport.Text = "Report";
|
||||
//
|
||||
// lbReportFormat
|
||||
//
|
||||
this.lbReportFormat.AutoSize = true;
|
||||
this.lbReportFormat.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.lbReportFormat.Location = new System.Drawing.Point(2, 17);
|
||||
this.lbReportFormat.Name = "lbReportFormat";
|
||||
this.lbReportFormat.Size = new System.Drawing.Size(39, 13);
|
||||
this.lbReportFormat.TabIndex = 0;
|
||||
this.lbReportFormat.Text = "Format";
|
||||
//
|
||||
// cbReportFormat
|
||||
//
|
||||
this.cbReportFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbReportFormat.FormattingEnabled = true;
|
||||
this.cbReportFormat.Items.AddRange(new object[] {
|
||||
"LRFD",
|
||||
"ASD"});
|
||||
this.cbReportFormat.Location = new System.Drawing.Point(196, 17);
|
||||
this.cbReportFormat.Name = "cbReportFormat";
|
||||
this.cbReportFormat.Size = new System.Drawing.Size(121, 21);
|
||||
this.cbReportFormat.TabIndex = 0;
|
||||
this.cbReportFormat.SelectedIndexChanged += new System.EventHandler(this.cbReportFormat_SelectedIndexChanged);
|
||||
//
|
||||
// Settings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.Controls.Add(this.gbReport);
|
||||
this.Name = "Settings";
|
||||
this.Size = new System.Drawing.Size(347, 285);
|
||||
this.gbReport.ResumeLayout(false);
|
||||
this.gbReport.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox gbReport;
|
||||
private System.Windows.Forms.Label lbReportFormat;
|
||||
private System.Windows.Forms.ComboBox cbReportFormat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2015 Autodesk, Inc. All rights reserved.
|
||||
//
|
||||
// Use of this software is subject to the terms of the Autodesk license
|
||||
// agreement provided at the time of installation or download, or which
|
||||
// otherwise accompanies this software in either electronic or hard copy form.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using AstSTEELAUTOMATIONLib;
|
||||
|
||||
namespace SampleDesign
|
||||
{
|
||||
public partial class Settings : UserControl
|
||||
{
|
||||
|
||||
#region Constructor
|
||||
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Visible = false;
|
||||
|
||||
cbReportFormat.Items.Clear();
|
||||
cbReportFormat.Items.Add("RTF");
|
||||
cbReportFormat.Items.Add("HTML");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private_Members
|
||||
|
||||
private INodeStressAppModule m_pCurSMRule;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public_Methods
|
||||
|
||||
public void setJoint(INodeStressAppModule pVal)
|
||||
{
|
||||
m_pCurSMRule = pVal;
|
||||
|
||||
|
||||
int nSelIndex = -1;
|
||||
try
|
||||
{
|
||||
nSelIndex = (int)m_pCurSMRule.Joint.GetJointNSAModuleSpecificData(m_pCurSMRule, "ReportFormat");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_pCurSMRule.Joint.SetJointNSAModuleSpecificData(m_pCurSMRule, 0, "ReportFormat");
|
||||
}
|
||||
if (nSelIndex > -1 && cbReportFormat.Items.Count > nSelIndex)
|
||||
cbReportFormat.SelectedIndex = nSelIndex;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private_Methods
|
||||
private void cbReportFormat_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_pCurSMRule.Joint.SetJointNSAModuleSpecificData(m_pCurSMRule, this.cbReportFormat.SelectedIndex, "ReportFormat");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,63 @@
|
||||
namespace SampleDesign
|
||||
{
|
||||
partial class SimpleTorsors
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SimpleTorsors));
|
||||
this.axSimpleTorsors = new AxASTCONTROLSLib.AxAstOCXGrid();
|
||||
((System.ComponentModel.ISupportInitialize)(this.axSimpleTorsors)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// axSimpleTorsors
|
||||
//
|
||||
this.axSimpleTorsors.Enabled = true;
|
||||
this.axSimpleTorsors.Location = new System.Drawing.Point(3, 22);
|
||||
this.axSimpleTorsors.Name = "axSimpleTorsors";
|
||||
this.axSimpleTorsors.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axSimpleTorsors.OcxState")));
|
||||
this.axSimpleTorsors.Size = new System.Drawing.Size(232, 70);
|
||||
this.axSimpleTorsors.TabIndex = 4;
|
||||
this.axSimpleTorsors.OnGridCellEdited += new AxASTCONTROLSLib._DAstOCXGridEvents_OnGridCellEditedEventHandler(this.axSimpleTorsors_OnGridCellEdited);
|
||||
//
|
||||
// SimpleTorsors
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.Controls.Add(this.axSimpleTorsors);
|
||||
this.Name = "SimpleTorsors";
|
||||
this.Size = new System.Drawing.Size(150, 150);
|
||||
((System.ComponentModel.ISupportInitialize)(this.axSimpleTorsors)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private AxASTCONTROLSLib.AxAstOCXGrid axSimpleTorsors;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2015 Autodesk, Inc. All rights reserved.
|
||||
//
|
||||
// Use of this software is subject to the terms of the Autodesk license
|
||||
// agreement provided at the time of installation or download, or which
|
||||
// otherwise accompanies this software in either electronic or hard copy form.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using AstSTEELAUTOMATIONLib;
|
||||
using Autodesk.AdvanceSteel.DotNetRoots.DatabaseAccess;
|
||||
using AxASTCONTROLSLib;
|
||||
|
||||
namespace SampleDesign
|
||||
{
|
||||
public partial class SimpleTorsors : UserControl
|
||||
{
|
||||
#region private members
|
||||
|
||||
private CreatePlateDesign m_CreatePlateDesign;
|
||||
double m_dMaxM;
|
||||
double m_dMaxN;
|
||||
double m_dMaxV;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SimpleTorsors()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Visible = false;
|
||||
|
||||
m_dMaxM = 0;
|
||||
m_dMaxN = 0;
|
||||
m_dMaxV = 0;
|
||||
|
||||
m_CreatePlateDesign = null;
|
||||
}
|
||||
|
||||
public void setJoint(CreatePlateDesign pVal)
|
||||
{
|
||||
m_dMaxM = 0;
|
||||
m_dMaxN = 0;
|
||||
m_dMaxV = 0;
|
||||
|
||||
m_CreatePlateDesign = pVal;
|
||||
setJoint(m_CreatePlateDesign, 1);
|
||||
setEnable(1, m_CreatePlateDesign);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private_Methods
|
||||
|
||||
private void axSimpleTorsors_OnGridCellEdited(object sender, _DAstOCXGridEvents_OnGridCellEditedEvent e)
|
||||
{
|
||||
double newM = 0;
|
||||
double newN = 0;
|
||||
double newT = 0;
|
||||
|
||||
int nRow = axSimpleTorsors.GetFocusCellRow();
|
||||
|
||||
newM = axSimpleTorsors.get_ItemDoubleValue(nRow, 0);
|
||||
newN = axSimpleTorsors.get_ItemDoubleValue(nRow, 1);
|
||||
newT = axSimpleTorsors.get_ItemDoubleValue(nRow, 2);
|
||||
|
||||
if (1 == nRow)
|
||||
setJointTorsorsValues(m_CreatePlateDesign, newM, newN, newT, "SimpleMaxTorsor");
|
||||
}
|
||||
|
||||
private void setJointTorsorsValues(INodeStressAppModule m_pCurSMRule, double dMaxM, double dMaxN, double dMaxT, string sLoadingCaseName)
|
||||
{
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
bool bFoundLoadingCase = false;
|
||||
|
||||
//get now the module loading cases
|
||||
JointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if ((null != spJointEfforts) && (spJointLoadingCase.Name == sLoadingCaseName))
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
spJointEfforts[0].Value = dMaxM;
|
||||
spJointEfforts[1].Value = dMaxN;
|
||||
spJointEfforts[2].Value = dMaxT;
|
||||
bFoundLoadingCase = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set back joint loading cases
|
||||
curSMJoint.SetJointNSAModuleLoadingCases(m_pCurSMRule, spJointLoadingCases);
|
||||
}
|
||||
|
||||
if (!bFoundLoadingCase)
|
||||
{
|
||||
//create loading case
|
||||
JointLoadingCase spJointLoadingCase = curSMJoint.CreateJointLoadingCase();
|
||||
|
||||
//create joint efforts
|
||||
JointEfforts spJointEfforts = curSMJoint.CreateJointEfforts();
|
||||
|
||||
JointEffort spEffortM = curSMJoint.CreateJointEffort();
|
||||
JointEffort spEffortN = curSMJoint.CreateJointEffort();
|
||||
JointEffort spEffortT = curSMJoint.CreateJointEffort();
|
||||
|
||||
spEffortM.Value = dMaxM;
|
||||
spEffortN.Value = dMaxN;
|
||||
spEffortT.Value = dMaxT;
|
||||
|
||||
spJointEfforts.Add(spEffortM);
|
||||
spJointEfforts.Add(spEffortN);
|
||||
spJointEfforts.Add(spEffortT);
|
||||
|
||||
spJointLoadingCase.JointEfforts = spJointEfforts;
|
||||
spJointLoadingCase.Name = sLoadingCaseName;
|
||||
|
||||
spJointLoadingCases.Add(spJointLoadingCase);
|
||||
|
||||
curSMJoint.SetJointNSAModuleLoadingCases(m_pCurSMRule, spJointLoadingCases);
|
||||
}
|
||||
}
|
||||
|
||||
private void setGridTorsorsValues(INodeStressAppModule m_pCurSMRule, int nRowIndex, string sLoadingCaseName)
|
||||
{
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get now the module loading cases
|
||||
IJointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
bool bFoundLoadingCase = false;
|
||||
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if ((null != spJointEfforts) && (spJointLoadingCase.Name == sLoadingCaseName))
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
bFoundLoadingCase = true;
|
||||
|
||||
m_dMaxM = (double)spJointEfforts[0].Value;
|
||||
m_dMaxN = (double)spJointEfforts[1].Value;
|
||||
m_dMaxV = (double)spJointEfforts[2].Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFoundLoadingCase)
|
||||
{
|
||||
m_dMaxM = 0;
|
||||
m_dMaxN = 0;
|
||||
m_dMaxV = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dMaxM = 0;
|
||||
m_dMaxN = 0;
|
||||
m_dMaxV = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//fill grid with found values
|
||||
axSimpleTorsors.set_ItemDoubleValue(nRowIndex, 0, m_dMaxM);
|
||||
axSimpleTorsors.set_ItemDoubleValue(nRowIndex, 1, m_dMaxN);
|
||||
axSimpleTorsors.set_ItemDoubleValue(nRowIndex, 2, m_dMaxV);
|
||||
|
||||
//set the values in the joint loading cases
|
||||
setJointTorsorsValues(m_CreatePlateDesign, m_dMaxM, m_dMaxN, m_dMaxV, sLoadingCaseName);
|
||||
}
|
||||
|
||||
private void setJoint(INodeStressAppModule m_pCurSMRule, int nNoRows)
|
||||
{
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get current units for Moment and Force
|
||||
IUnitsManager units = curSMJoint.Units;
|
||||
IUnit momentUnit = (AstSTEELAUTOMATIONLib.IUnit)new DSCROOTSCOMLib.UnitClass();
|
||||
IUnit forceUnit = (AstSTEELAUTOMATIONLib.IUnit)new DSCROOTSCOMLib.UnitClass();
|
||||
units.getUnitOfMoment(momentUnit);
|
||||
units.getUnitOfForce(forceUnit);
|
||||
|
||||
string strMomentUnit = "???", strForceUnit = "???";
|
||||
strMomentUnit = momentUnit.getSymbol();
|
||||
strForceUnit = forceUnit.getSymbol();
|
||||
|
||||
string strM_txt = AstCrtlDb.Instance.readUPS_PRP(41200);//"M"
|
||||
string strN_txt = AstCrtlDb.Instance.readUPS_PRP(41201);//"N"
|
||||
string strV_txt = AstCrtlDb.Instance.readUPS_PRP(41202);//"V"
|
||||
|
||||
string strCol_M_Name = strM_txt + " (" + strMomentUnit + ")";
|
||||
string strCol_N_Name = strN_txt + " (" + strForceUnit + ")";
|
||||
string strCol_V_Name = strV_txt + " (" + strForceUnit + ")";
|
||||
|
||||
//fill torsors grid
|
||||
axSimpleTorsors.DeleteAllItems();
|
||||
axSimpleTorsors.FixedRowCount = 1;
|
||||
axSimpleTorsors.ColumnCount = 3;
|
||||
axSimpleTorsors.RowCount = nNoRows + 1;
|
||||
|
||||
axSimpleTorsors.Height = 20 + (20 * nNoRows);
|
||||
axSimpleTorsors.ExpandToFit();
|
||||
|
||||
axSimpleTorsors.set_ItemTextValue(0, 0, strCol_M_Name);
|
||||
axSimpleTorsors.set_ItemTextValue(0, 1, strCol_N_Name);
|
||||
axSimpleTorsors.set_ItemTextValue(0, 2, strCol_V_Name);
|
||||
|
||||
//column "M"
|
||||
axSimpleTorsors.set_ColumnType(0, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axSimpleTorsors.set_ColumnDataType(0, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axSimpleTorsors.set_ColumnUnits(0, ASTCONTROLSLib.eCellUnitType.kUnitMoment); //kUnitMoment
|
||||
|
||||
//column "N"
|
||||
axSimpleTorsors.set_ColumnType(1, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axSimpleTorsors.set_ColumnDataType(1, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axSimpleTorsors.set_ColumnUnits(1, ASTCONTROLSLib.eCellUnitType.kUnitForce); //kUnitForce
|
||||
|
||||
//column "T"
|
||||
axSimpleTorsors.set_ColumnType(2, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axSimpleTorsors.set_ColumnDataType(2, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axSimpleTorsors.set_ColumnUnits(2, ASTCONTROLSLib.eCellUnitType.kUnitForce); //kUnitForce
|
||||
|
||||
//check if the detailed torsors should be used
|
||||
if (true == curSMJoint.UseDetailedTorsors)
|
||||
{
|
||||
for (int j = 1; j <= nNoRows; j++)
|
||||
{
|
||||
axSimpleTorsors.EnableCell(j, 0, 0);
|
||||
axSimpleTorsors.EnableCell(j, 1, 0);
|
||||
axSimpleTorsors.EnableCell(j, 2, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int j = 1; j <= nNoRows; j++)
|
||||
{
|
||||
axSimpleTorsors.EnableCell(j, 0, 1);
|
||||
axSimpleTorsors.EnableCell(j, 1, 1);
|
||||
axSimpleTorsors.EnableCell(j, 2, 1);
|
||||
}
|
||||
}
|
||||
|
||||
setGridTorsorsValues(m_pCurSMRule, 1, "SimpleMaxTorsor");
|
||||
}
|
||||
|
||||
private void setEnable(int nRow, INodeStressAppModule m_pCurSMRule)
|
||||
{
|
||||
axSimpleTorsors.EnableCell(nRow, 0, 0);
|
||||
axSimpleTorsors.EnableCell(nRow, 1, 0);
|
||||
axSimpleTorsors.EnableCell(nRow, 2, 0);
|
||||
|
||||
if (false == m_pCurSMRule.Joint.UseDetailedTorsors)
|
||||
{
|
||||
axSimpleTorsors.EnableCell(nRow, 0, (short)1);
|
||||
axSimpleTorsors.EnableCell(nRow, 1, (short)1);
|
||||
axSimpleTorsors.EnableCell(nRow, 2, (short)1);
|
||||
}
|
||||
|
||||
axSimpleTorsors.Refresh();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="axSimpleTorsors.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAJQAAAAIB
|
||||
AAAAAQAAAAAAAAAAAAAAABAAAAADAAEA+hcAADwHAAAAAAAACw==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,91 @@
|
||||
namespace SampleDesign
|
||||
{
|
||||
partial class Torsors
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Torsors));
|
||||
this.btnDelLoading = new System.Windows.Forms.Button();
|
||||
this.btnAddLoading = new System.Windows.Forms.Button();
|
||||
this.axTorsors = new AxASTCONTROLSLib.AxAstOCXGrid();
|
||||
((System.ComponentModel.ISupportInitialize)(this.axTorsors)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnDelLoading
|
||||
//
|
||||
this.btnDelLoading.Image = ((System.Drawing.Image)(resources.GetObject("btnDelLoading.Image")));
|
||||
this.btnDelLoading.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.btnDelLoading.Location = new System.Drawing.Point(479, 249);
|
||||
this.btnDelLoading.Name = "btnDelLoading";
|
||||
this.btnDelLoading.Size = new System.Drawing.Size(24, 23);
|
||||
this.btnDelLoading.TabIndex = 10;
|
||||
this.btnDelLoading.UseVisualStyleBackColor = true;
|
||||
this.btnDelLoading.ClientSizeChanged += new System.EventHandler(this.btnDelLoading_Click);
|
||||
//
|
||||
// btnAddLoading
|
||||
//
|
||||
this.btnAddLoading.Image = ((System.Drawing.Image)(resources.GetObject("btnAddLoading.Image")));
|
||||
this.btnAddLoading.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.btnAddLoading.Location = new System.Drawing.Point(451, 249);
|
||||
this.btnAddLoading.Name = "btnAddLoading";
|
||||
this.btnAddLoading.Size = new System.Drawing.Size(24, 23);
|
||||
this.btnAddLoading.TabIndex = 9;
|
||||
this.btnAddLoading.UseVisualStyleBackColor = true;
|
||||
this.btnAddLoading.Click += new System.EventHandler(this.btnAddLoading_Click);
|
||||
//
|
||||
// axTorsors
|
||||
//
|
||||
this.axTorsors.Enabled = true;
|
||||
this.axTorsors.Location = new System.Drawing.Point(3, 3);
|
||||
this.axTorsors.Name = "axTorsors";
|
||||
this.axTorsors.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axTorsors.OcxState")));
|
||||
this.axTorsors.Size = new System.Drawing.Size(499, 116);
|
||||
this.axTorsors.TabIndex = 8;
|
||||
this.axTorsors.OnGridCellEdited += new AxASTCONTROLSLib._DAstOCXGridEvents_OnGridCellEditedEventHandler(this.axTorsors_OnGridCellEdited);
|
||||
//
|
||||
// Torsors
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.Controls.Add(this.btnDelLoading);
|
||||
this.Controls.Add(this.btnAddLoading);
|
||||
this.Controls.Add(this.axTorsors);
|
||||
this.Name = "Torsors";
|
||||
this.Size = new System.Drawing.Size(150, 150);
|
||||
((System.ComponentModel.ISupportInitialize)(this.axTorsors)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnDelLoading;
|
||||
private System.Windows.Forms.Button btnAddLoading;
|
||||
private AxASTCONTROLSLib.AxAstOCXGrid axTorsors;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,455 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright 2015 Autodesk, Inc. All rights reserved.
|
||||
//
|
||||
// Use of this software is subject to the terms of the Autodesk license
|
||||
// agreement provided at the time of installation or download, or which
|
||||
// otherwise accompanies this software in either electronic or hard copy form.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using AstSTEELAUTOMATIONLib;
|
||||
using Autodesk.AdvanceSteel.DotNetRoots.DatabaseAccess;
|
||||
|
||||
namespace SampleDesign
|
||||
{
|
||||
public partial class Torsors : UserControl
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
public Torsors()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Visible = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private members
|
||||
|
||||
private CreatePlateDesign m_JointDesignSample;
|
||||
|
||||
#endregion
|
||||
|
||||
public void setJoint(CreatePlateDesign pVal)
|
||||
{
|
||||
m_JointDesignSample = pVal;
|
||||
|
||||
if (m_JointDesignSample != null)
|
||||
callFillGridData(m_JointDesignSample);
|
||||
}
|
||||
|
||||
private void axTorsors_OnGridCellEdited(object sender, AxASTCONTROLSLib._DAstOCXGridEvents_OnGridCellEditedEvent e)
|
||||
{
|
||||
int nRow = axTorsors.GetFocusCellRow();
|
||||
int nCol = axTorsors.GetFocusCellColumn();
|
||||
|
||||
if (m_JointDesignSample != null)
|
||||
callGridCellEditedTorsors(m_JointDesignSample, nRow, nCol);
|
||||
}
|
||||
|
||||
private void btnAddLoading_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_JointDesignSample != null)
|
||||
callAddLoading(m_JointDesignSample);
|
||||
}
|
||||
|
||||
private void btnDelLoading_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (m_JointDesignSample != null)
|
||||
callDelLoading(m_JointDesignSample);
|
||||
}
|
||||
|
||||
private void callAddLoading(INodeStressAppModule m_pCurSMRule)
|
||||
{
|
||||
//add new loading in joint
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get now the module loading cases / efforts
|
||||
JointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
JointLoadingCase spNewCase;
|
||||
JointEfforts spNewEfforts;
|
||||
JointEffort spNewEffortM, spNewEffortN, spNewEffortV;
|
||||
|
||||
spNewEffortM = curSMJoint.CreateJointEffort();
|
||||
spNewEffortN = curSMJoint.CreateJointEffort();
|
||||
spNewEffortV = curSMJoint.CreateJointEffort();
|
||||
spNewEfforts = curSMJoint.CreateJointEfforts();
|
||||
spNewCase = curSMJoint.CreateJointLoadingCase();
|
||||
|
||||
double newVal = 0.0;
|
||||
|
||||
spNewEffortM.Name = "M";
|
||||
spNewEffortM.Value = newVal;
|
||||
|
||||
spNewEffortN.Name = "N";
|
||||
spNewEffortN.Value = newVal;
|
||||
|
||||
spNewEffortV.Name = "V";
|
||||
spNewEffortV.Value = newVal;
|
||||
|
||||
spNewEfforts.Add(spNewEffortM);
|
||||
spNewEfforts.Add(spNewEffortN);
|
||||
spNewEfforts.Add(spNewEffortV);
|
||||
|
||||
string strLoadingName = createInternalLoadingName("-");
|
||||
|
||||
spNewCase.Name = strLoadingName;
|
||||
spNewCase.JointEfforts = spNewEfforts;
|
||||
|
||||
spJointLoadingCases.Add(spNewCase);
|
||||
curSMJoint.SetJointNSAModuleLoadingCases(m_pCurSMRule, spJointLoadingCases);
|
||||
}
|
||||
|
||||
|
||||
//add new line in grid
|
||||
string lineHeader = getNextLineHeader().ToString();
|
||||
axTorsors.InsertRow(ref lineHeader, axTorsors.RowCount - 1);
|
||||
|
||||
//description
|
||||
axTorsors.set_ItemTextValue(axTorsors.RowCount - 1, 1, "-");
|
||||
//M
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 2, 0);
|
||||
//N
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 3, 0);
|
||||
//V
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 4, 0);
|
||||
}
|
||||
|
||||
private void callDelLoading(INodeStressAppModule m_pCurSMRule)
|
||||
{
|
||||
int selectedRow = axTorsors.GetFocusCellRow();
|
||||
|
||||
if (selectedRow > (axTorsors.FixedRowCount - 1))
|
||||
{
|
||||
//get the real index of the torsor in the NSA module data
|
||||
int realTorsorIndex = getTorsorIndex(selectedRow, 0);
|
||||
if (-1 == realTorsorIndex)
|
||||
return;
|
||||
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
//get now the module loading cases / efforts
|
||||
IJointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
JointLoadingCases spNewCases = curSMJoint.CreateJointLoadingCases();
|
||||
|
||||
if (null != spNewCases)
|
||||
{
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
if (i != realTorsorIndex) //remove selected torsor
|
||||
{
|
||||
JointLoadingCase spOldCase = spJointLoadingCases[i];
|
||||
spNewCases.Add(spOldCase);
|
||||
}
|
||||
}
|
||||
|
||||
//set back the remaining torsors
|
||||
curSMJoint.SetJointNSAModuleLoadingCases(m_pCurSMRule, spNewCases);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
axTorsors.DeleteRow(selectedRow);
|
||||
}
|
||||
}
|
||||
|
||||
private void callGridCellEditedTorsors(INodeStressAppModule m_pCurSMRule, int nRow, int nCol)
|
||||
{
|
||||
//get the real index of the torsor in the NSA module data
|
||||
int realTorsorIndex = getTorsorIndex(nRow, nCol);
|
||||
if (-1 == realTorsorIndex)
|
||||
return;
|
||||
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get now the module loading cases
|
||||
try
|
||||
{
|
||||
JointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[realTorsorIndex];
|
||||
|
||||
string strCaseName = spJointLoadingCase.Name;
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if (null != spJointEfforts)
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
IJointEffort spEffortM, spEffortN, spEffortV; //M, N, V
|
||||
|
||||
spEffortM = spJointEfforts[0];
|
||||
spEffortN = spJointEfforts[1];
|
||||
spEffortV = spJointEfforts[2];
|
||||
|
||||
if (1 == nCol) // "Description" was modified
|
||||
{
|
||||
string strNew = axTorsors.get_ItemTextValue(nRow, nCol);
|
||||
spJointLoadingCase.Name = createInternalLoadingName(strNew);
|
||||
}
|
||||
else // "M", "N" or "V" modified
|
||||
{
|
||||
double dfNew = axTorsors.get_ItemDoubleValue(nRow, nCol);
|
||||
if (2 == nCol) // "M"
|
||||
spEffortM.Value= dfNew;
|
||||
if (3 == nCol) // "N"
|
||||
spEffortN.Value = dfNew;
|
||||
if (4 == nCol) // "V"
|
||||
spEffortV.Value = dfNew;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//set back joint loading cases
|
||||
curSMJoint.SetJointNSAModuleLoadingCases(m_pCurSMRule, spJointLoadingCases);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.Write(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void callFillGridData(INodeStressAppModule m_pCurSMRule)
|
||||
{
|
||||
//fill torsors grid
|
||||
axTorsors.DeleteAllItems();
|
||||
axTorsors.RowCount = 1;
|
||||
axTorsors.ColumnCount = 5;
|
||||
axTorsors.FixedRowCount = 1;
|
||||
axTorsors.FixedColumnCount = 1;
|
||||
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get current units for Moment and Force
|
||||
IUnitsManager units = curSMJoint.Units;
|
||||
IUnit momentUnit = (IUnit)(new DSCROOTSCOMLib.UnitClass());
|
||||
IUnit forceUnit = (IUnit)(new DSCROOTSCOMLib.UnitClass());
|
||||
units.getUnitOfMoment(momentUnit);
|
||||
units.getUnitOfForce(forceUnit);
|
||||
|
||||
string strMomentUnit = "???", strForceUnit = "???";
|
||||
strMomentUnit = momentUnit.getSymbol();
|
||||
strForceUnit = forceUnit.getSymbol();
|
||||
|
||||
string strM_txt = AstCrtlDb.Instance.readUPS_PRP(41200);//"M"
|
||||
string strN_txt = AstCrtlDb.Instance.readUPS_PRP(41201);//"N"
|
||||
string strV_txt = AstCrtlDb.Instance.readUPS_PRP(41202);//"V"
|
||||
|
||||
string strCol_M_Name = strM_txt + " (" + strMomentUnit + ")";
|
||||
string strCol_N_Name = strN_txt + " (" + strForceUnit + ")";
|
||||
string strCol_V_Name = strV_txt + " (" + strForceUnit + ")";
|
||||
|
||||
string strIndexName = "Case", strDescriptionName = "Name";
|
||||
strDescriptionName = AstCrtlDb.Instance.readUPS_PRP(147);
|
||||
strIndexName = AstCrtlDb.Instance.readUPS_PRP(146);
|
||||
|
||||
axTorsors.set_ItemTextValue(0, 0, strIndexName);
|
||||
axTorsors.set_ItemTextValue(0, 1, strDescriptionName);
|
||||
axTorsors.set_ItemTextValue(0, 2, strCol_M_Name);
|
||||
axTorsors.set_ItemTextValue(0, 3, strCol_N_Name);
|
||||
axTorsors.set_ItemTextValue(0, 4, strCol_V_Name);
|
||||
|
||||
axTorsors.set_ColumnWidth(0, 50);
|
||||
axTorsors.set_ColumnWidth(1, 95);
|
||||
axTorsors.set_ColumnWidth(2, 50);
|
||||
axTorsors.set_ColumnWidth(3, 50);
|
||||
axTorsors.set_ColumnWidth(4, 50);
|
||||
|
||||
//column "Description"
|
||||
axTorsors.set_ColumnType(1, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axTorsors.set_ColumnDataType(1, ASTCONTROLSLib.eCellDataType.kString); //kString
|
||||
|
||||
//column "M"
|
||||
axTorsors.set_ColumnType(2, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axTorsors.set_ColumnDataType(2, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axTorsors.set_ColumnUnits(2, ASTCONTROLSLib.eCellUnitType.kUnitMoment); //kUnitMoment
|
||||
|
||||
//column "N"
|
||||
axTorsors.set_ColumnType(3, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axTorsors.set_ColumnDataType(3, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axTorsors.set_ColumnUnits(3, ASTCONTROLSLib.eCellUnitType.kUnitForce); //kUnitForce
|
||||
|
||||
//column "V"
|
||||
axTorsors.set_ColumnType(4, ASTCONTROLSLib.eColumnType.kEditBox); //kEditBox
|
||||
axTorsors.set_ColumnDataType(4, ASTCONTROLSLib.eCellDataType.kUnits); //kUnits
|
||||
axTorsors.set_ColumnUnits(4, ASTCONTROLSLib.eCellUnitType.kUnitForce); //kUnitForce
|
||||
|
||||
|
||||
//get now the module loading cases
|
||||
IJointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
IJointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
IJointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
string strCaseName = spJointLoadingCase.Name;
|
||||
|
||||
if ((null != spJointEfforts) &&(strCaseName != "SimpleMaxTorsor"))
|
||||
{
|
||||
if (3 == (int)spJointEfforts.Count)
|
||||
{
|
||||
JointEffort spEffortM, spEffortN, spEffortV; //M, N, V
|
||||
double dfEffM, dfEffN, dfEffV;
|
||||
|
||||
spEffortM = spJointEfforts[0];
|
||||
spEffortN = spJointEfforts[1];
|
||||
spEffortV = spJointEfforts[2];
|
||||
|
||||
dfEffM = (double)spEffortM.Value;
|
||||
dfEffN = (double)spEffortN.Value;
|
||||
dfEffV = (double)spEffortV.Value;
|
||||
|
||||
//add new line in grid
|
||||
string strLineHeader = getNextLineHeader().ToString();
|
||||
axTorsors.InsertRow(ref strLineHeader, axTorsors.RowCount - 1);
|
||||
|
||||
//description
|
||||
axTorsors.set_ItemTextValue(axTorsors.RowCount - 1, 1, getUserLoadingName(strCaseName));
|
||||
//M
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 2, dfEffM);
|
||||
//N
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 3, dfEffN);
|
||||
//T
|
||||
axTorsors.set_ItemDoubleValue(axTorsors.RowCount - 1, 4, dfEffV);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
axTorsors.AutoSize();
|
||||
axTorsors.GridBkColor = SystemColors.Window;
|
||||
}
|
||||
|
||||
private long getNextLineHeader()
|
||||
{
|
||||
long nextLineNumber = 0;
|
||||
|
||||
//add a line with the next largest number
|
||||
long existingMax = 0;
|
||||
|
||||
nextLineNumber = axTorsors.RowCount;
|
||||
|
||||
//get the existing max number
|
||||
long rowCount = axTorsors.RowCount;
|
||||
if (rowCount > 1)
|
||||
{
|
||||
for (int i = 1; i < rowCount; i++)
|
||||
{
|
||||
int thisVal = 0;
|
||||
thisVal = int.Parse(axTorsors.get_ItemTextValue(i, 0));
|
||||
if (thisVal > existingMax)
|
||||
existingMax = thisVal;
|
||||
}
|
||||
}
|
||||
|
||||
if (existingMax >= axTorsors.RowCount)
|
||||
nextLineNumber = existingMax + 1;
|
||||
|
||||
return nextLineNumber;
|
||||
}
|
||||
|
||||
private int getTorsorIndex(int gridRow, int gridCol)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
if (m_JointDesignSample != null)
|
||||
result = callGetTorsorsIndex(m_JointDesignSample, gridRow, gridCol);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int callGetTorsorsIndex(INodeStressAppModule m_pCurSMRule, int gridRow, int gridCol)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
IStressModuleJoint curSMJoint = m_pCurSMRule.Joint;
|
||||
|
||||
//get now the module loading cases
|
||||
IJointLoadingCases spJointLoadingCases = curSMJoint.GetJointNSAModuleLoadingCases(m_pCurSMRule);
|
||||
|
||||
if (null != spJointLoadingCases)
|
||||
{
|
||||
if ((int)spJointLoadingCases.Count > 0)
|
||||
{
|
||||
int nLocatingIndex = 0;
|
||||
|
||||
for (int i = 0; i < (int)spJointLoadingCases.Count; i++)
|
||||
{
|
||||
JointLoadingCase spJointLoadingCase = spJointLoadingCases[i];
|
||||
JointEfforts spJointEfforts = spJointLoadingCase.JointEfforts;
|
||||
|
||||
if ((null != spJointEfforts) && (spJointLoadingCase.Name != "SimpleMaxTorsor"))
|
||||
{
|
||||
if ((gridRow - axTorsors.FixedRowCount) == nLocatingIndex) //found the index we want
|
||||
{
|
||||
result = i;
|
||||
}
|
||||
nLocatingIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private string createInternalLoadingName(string strLoadingName)
|
||||
{
|
||||
string strInternalName = string.Format("Beam {0:D} #@#@#", 1);
|
||||
strInternalName = strInternalName + strLoadingName;
|
||||
return strInternalName;
|
||||
}
|
||||
|
||||
private string getUserLoadingName(string strInternalName)
|
||||
{
|
||||
int nStartIndex = 12;
|
||||
bool bSeparatorExists = strInternalName.Contains("#@#@#");
|
||||
bool bLongSeparatorExists = strInternalName.Contains("#@#@#@#");
|
||||
if (bLongSeparatorExists)
|
||||
{
|
||||
bSeparatorExists = true;
|
||||
nStartIndex = 14;
|
||||
}
|
||||
if (bSeparatorExists)
|
||||
return strInternalName.Substring(nStartIndex);
|
||||
else
|
||||
return strInternalName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnDelLoading.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAIhJREFUWEftlNEK
|
||||
wCAIRf10/3zNQBBpyx5uEdxosEHsHo9uIlw0QAM0cIOBR+Tdh5aF+3UIoZdfhoDZmkGoaoeEWvqC2Nqi
|
||||
COFVwyvPWmPw9nCDiRbs3oCgvY8vz3Pgz3CI3PsRFAziL9xBYCYq4Q4B+ypU6z8YGMTqlMPmYRWE52mA
|
||||
BmhgZqABX42IDaWvyEAAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnAddLoading.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAALZJREFUWEftlVEK
|
||||
wCAIQD16R+tmLQmXRmWQ/oSCMNbA11McQEQYCANhQDGQUiq7dBeIxXPO08QzgFLTMQigTILOXCE0gFac
|
||||
0sGEBkDz4WZhB0BdwRlp8+AQGgAWl20wHsodgCyOBnqaGVkBjMWpHeYQOkC7dQfAFnAbl3OxAqC+z/YD
|
||||
vusQrwCM61hOPm+BHMbL+1eR/77nG48/jzNg2H+k1/+G442NAc4UGms/KxpfhYEw8IiBD3KjPijZGMVL
|
||||
AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="axTorsors.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAJQAAAAIB
|
||||
AAAAAQAAAAAAAAAAAAAAABAAAAADAAEAkzMAAP0LAAAAAAAACw==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user