copied Revit 2024 SDK

This commit is contained in:
Jeremy Tammik
2023-04-26 14:47:47 +02:00
parent 2ca39e38fd
commit 4d69f3eea5
425 changed files with 344414 additions and 2296 deletions
@@ -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("SampleClipAngle")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Autodesk, Inc.")]
[assembly: AssemblyProduct("SampleClipAngle")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2022")]
[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("8cff2bfd-0e4d-4a20-95f4-c1fd4bdf0703")]
// 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,468 @@
using AstSTEELAUTOMATIONLib;
using DSCODBCCOMLib;
using System;
using System.Runtime.InteropServices;
namespace SampleClipAngle
{
[ComVisible(true)]
[Guid("8B4FDDC8-946A-49B4-AF65-AC54C5615AB1")]
public class SampleClipAngle : IRule
{
private Joint m_Joint = null;
public String m_sProfType;
public String m_sProfSize;
public String m_sBoltsStandard;
public String m_sBoltsMaterial;
public String m_sBoltsSet;
public double m_dBoltsDiameter;
private SampleClipUI m_GUI = null;
private void SplitBeamsInternalName(string fullInternal, out string classInternal, out string sectionInternal)
{
const string separator = "#@§@#";
classInternal = string.Empty;
sectionInternal = string.Empty;
int position = fullInternal.IndexOf(separator);
if (position > 0)
{
classInternal = fullInternal.Substring(0, position);
sectionInternal = fullInternal.Substring(position + separator.Length);
}
}
public void Query(AstUI pAstUI)
{
IClassFilter classFilter;
classFilter = pAstUI.GetClassFilter();
classFilter.AppendAcceptedClass(eClassType.kBeamStraightClass);
//Declare the input objects
AstObjectsArr inputObjectsArr = m_Joint.CreateObjectsArray();
//Get the column
eUIErrorCodes errCode;
IAstObject selectedColumn = pAstUI.AcquireSingleObject(163, out errCode);
//selection incorrect
if (errCode == eUIErrorCodes.kUIError)
return;
//user abort the selection
if (errCode == eUIErrorCodes.kUICancel)
return;
//add selected object to the input objects array
if (selectedColumn != null)
inputObjectsArr.Add(selectedColumn);
//Get the beam
IAstObject selectedBeam = pAstUI.AcquireSingleObject(163, out errCode);
//selection incorrect
if (errCode == eUIErrorCodes.kUIError)
return;
//user abort the selection
if (errCode == eUIErrorCodes.kUICancel)
return;
//add selected object to the input objects array
if (selectedBeam != null)
inputObjectsArr.Add(selectedBeam);
//add all the objects selected by the user(input objects)
m_Joint.InputObjects = inputObjectsArr;
IOdbcUtils tableUtils = new DSCODBCCOMLib.OdbcUtils();
string defAngle = tableUtils.GetDefaultString(0, "HyperSectionW");
SplitBeamsInternalName(defAngle, out m_sProfType, out m_sProfSize);
m_sBoltsStandard = tableUtils.GetDefaultString(401, "Norm");
m_sBoltsMaterial = tableUtils.GetDefaultString(401, "Material");
m_sBoltsSet = tableUtils.GetDefaultString(401, "Garnitur");
m_dBoltsDiameter = tableUtils.GetDefaultDouble(401, "Diameter");
}
public void InField(IFiler pFiler)
{
int version = pFiler.readVersion(); //Returns the current rule version.
m_sProfType = (string)pFiler.readItem("ProfType");
m_sProfSize = (string)pFiler.readItem("ProfSize");
m_dBoltsDiameter = (double)pFiler.readItem("BoltsDiameter");
m_sBoltsStandard = (string)pFiler.readItem("BoltsStandard");
m_sBoltsMaterial = (string)pFiler.readItem("BoltsMaterial");
m_sBoltsSet = (string)pFiler.readItem("BoltsSet");
}
public void OutField(IFiler pFiler)
{
pFiler.writeVersion(1); //Set the current rule version
pFiler.writeItem(m_sProfType, "ProfType");
pFiler.writeItem(m_sProfSize, "ProfSize");
pFiler.writeItem(m_dBoltsDiameter, "BoltsDiameter");
pFiler.writeItem(m_sBoltsStandard, "BoltsStandard");
pFiler.writeItem(m_sBoltsMaterial, "BoltsMaterial");
pFiler.writeItem(m_sBoltsSet, "BoltsSet");
}
public string GetTableName()
{
return "";
}
//Returns the beam cs at the given point
private void GetBeamCSAtPoint(IBeam beam, IPoint3d point, out ICS3d cs)
{
//Get the beam cs at start
ICS3d startCS = beam.getSysCSAt(eBeamEnd.kBeamStart);
IMatrix3d alignMatrix;
//Get the closest point on the system line to the input point
IPoint3d closestPoint = beam.getClosestPointToSystemline(point, false);
cs = beam.getCSAtPoint(closestPoint);
//Get the transform matrix for the cs at the input point
alignMatrix = startCS.SetToAlignCS(cs);
//Change the closest point to the cs origin
closestPoint.setFrom(cs.Origin);
//Get the offset of the beam system
IVector3d spOffsetVector = beam.GetCurrentSys2Phys3dOffset();
//Transform and translate the cs
spOffsetVector.TransformBy(alignMatrix);
closestPoint.Add(spOffsetVector);
cs.Origin = closestPoint;
}
IPoint3dArray IntersectBeam(IStraightBeam beam, IPoint3d linePt, IVector3d lineVect)
{
//Create a line from the input point and vector
ILine3d line = (ILine3d)(new DSCGEOMCOMLib.Line3d());
line.CreateFromVectorAndPoint(linePt, lineVect);
//Get the body of the column
IAstModeler bodyColumn = beam.getAstModeler(eBodyContext.kBodyUnNotched);
//Interect it with the line
IPoint3dArray result = bodyColumn.intersectWithLine(line);
//Return the resulted intersection points
return result;
}
IPlane GetFacePlane(IStraightBeam inputColumn, IStraightBeam inputBeam)
{
//Result plane
IPlane plane = (IPlane)(new DSCGEOMCOMLib.plane());
//Get the beam outer cs
eBeamEnd beamStart;
ICS3d outerCS;
inputBeam.getCutOuterCS(true, inputColumn, -1, out outerCS, out beamStart, true);
//Change the z vector direction
IVector3d outerVectZ = outerCS.ZAxis;
outerVectZ.Multiply(-1);
IPoint3d outerCSOrigin = outerCS.Origin;
//Get the column cs at the outer cs origin
ICS3d mainCSAtPoint;
GetBeamCSAtPoint(inputColumn, outerCSOrigin, out mainCSAtPoint);
//Compute tranformation matrix
IPoint3d axisPoint = mainCSAtPoint.Origin;
ICS3d midCS = inputColumn.PhysicalCSMid;
IMatrix3d alignMatrix = mainCSAtPoint.SetToAlignCS(midCS);
//Transform the points which will constitute the line which we want to intersect with the beam
axisPoint.TransformBy(alignMatrix);
outerVectZ.TransformBy(alignMatrix);
//Get the intersection points
IPoint3dArray intersectionPts = IntersectBeam(inputColumn, axisPoint, outerVectZ);
//If we have intersection points, create a plane at the first intersection point
if (intersectionPts.Count != 0)
{
IPoint3d tempPt = intersectionPts[0];
axisPoint.setFrom(tempPt);
alignMatrix = midCS.SetToAlignCS(mainCSAtPoint);
axisPoint.TransformBy(alignMatrix);
outerVectZ.TransformBy(alignMatrix);
plane.CreateFromPointAndNormal(axisPoint, outerVectZ);
}
return plane;
}
private void MovePoint(IPoint3d ptIn, IVector3d vMove, double moveDist, out IPoint3d retPoint)
{
retPoint = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
retPoint.setFrom(ptIn);
IVector3d v = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
v.setFrom(vMove);
v.Normalize();
v.Multiply(moveDist);
retPoint.Add(v);
}
public void CreateBoltPattern(string boltRole,
double dBoltWidth,
double dBoltHeight,
int nXBolts,
int nYBolts,
ICS3d csBolts,
IStraightBeam cleat1,
IStraightBeam cleat2,
IStraightBeam beam,
ref AstObjectsArr createdObjectsArr)
{
Role role = m_Joint.CreateRole(boltRole); //role object
IBolt bolt = m_Joint.CreateBoltFinitRect(role, m_sBoltsMaterial, m_sBoltsStandard, 0, 0, dBoltHeight, dBoltWidth, nXBolts, nYBolts, m_dBoltsDiameter, csBolts);
if (bolt != null)
{
AstObjectsArr conObj = m_Joint.CreateObjectsArray();
conObj.Add(cleat1);
if (cleat2 != null)
conObj.Add(cleat2);
conObj.Add(beam);
bolt.Connect(conObj, eAssembleLocation.kOnSite);
createdObjectsArr.Add(bolt);
}
}
public void CreateObjects()
{
bool bCreationStatus = true;
//declare the created objects
AstObjectsArr createdObjectsArr = m_Joint.CreateObjectsArray();
try
{
//retrieve the beam & the column from the input objects array
AstObjectsArr arrObjects = m_Joint.InputObjects;
IStraightBeam inputColumn = null;
IStraightBeam inputBeam = null;
if (arrObjects != null)
{
int nObjs = arrObjects.Count;
if (nObjs > 1)
{
IAstObject astObj1 = arrObjects[0];
if (astObj1 != null)
{
if (astObj1.Type == eClassType.kBeamStraightClass)
inputColumn = (IStraightBeam)astObj1;
}
IAstObject astObj2 = arrObjects[1];
if (astObj2 != null)
{
if (astObj2.Type == eClassType.kBeamStraightClass)
inputBeam = (IStraightBeam)astObj2;
}
}
}
if (inputBeam != null && inputColumn != null)
{
ICS3d csColumn = inputColumn.cs;
ICS3d csBeam = inputBeam.cs;
if (csBeam.ZAxis.IsPerpendicularTo(csColumn.ZAxis))
{
//Get the plane where the beam and shortening intersect
IPlane plShortening = GetFacePlane(inputColumn, inputBeam);
eBeamEnd beamCutEnd;
IPoint3d ptClosestOnColumn = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
ptClosestOnColumn.setFrom(plShortening.PointOnPlane);
//Get the beam cs in the closest point on the column
ICS3d csBeamAtIntersectionPoint = inputBeam.getCSAtPoint(ptClosestOnColumn);
//Find the cs where at the beam end that needs to be cut
ICS3d csCutBeam;
inputBeam.getCutOuterCS(true, inputColumn, -1, out csCutBeam, out beamCutEnd, true);
//Add a shortening to trim/extend the beam until it touches the column
IBeamShortening shortening = inputBeam.addBeamShortening(beamCutEnd, plShortening);
if (shortening != null)
createdObjectsArr.Add(shortening);
//Create an L shaped beam as the first clip angle cleat
//We want to put 2 L shaped beams perpendicular to the input beam - on the input beam Z
IProfType profType = (IProfType)(new DSCPROFILESACCESSCOMLib.ProfType());
profType.createProfType(m_sProfType, m_sProfSize);
IVector3d vectLBeamDir = csBeamAtIntersectionPoint.ZAxis;
IVector3d vectLBeamTranslationX = csBeamAtIntersectionPoint.XAxis;
IVector3d vectLBeamTranslationY = csBeamAtIntersectionPoint.YAxis;
//Compute the first cleat it's start/endpoints
IPoint3d ptCleatStart = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
MovePoint(plShortening.PointOnPlane, vectLBeamDir, -100, out ptCleatStart);
//Find the beam we thickness and offset the cleat outside it a bit
IProfType profBeam = inputBeam.getProfType();
double dBeamWeb = profBeam.getGeometricalData(eProfCommonData.kWeb);
MovePoint(ptCleatStart, vectLBeamTranslationY, -dBeamWeb / 2, out ptCleatStart);
IPoint3d ptCleatEnd = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
MovePoint(ptCleatStart, vectLBeamDir, 200, out ptCleatEnd);
//Create a model role for the first cleat
IRole spRole = m_Joint.CreateRole("Angle_Cleat#1");
ICS3d csCleat = (ICS3d)(new DSCGEOMCOMLib.CS3d());
csCleat.setFrom(csBeamAtIntersectionPoint);
csCleat.RotateCSAroundY(Math.PI / 2);
csCleat.RotateCSAroundX(Math.PI);
//Finnaly, create the beam
IStraightBeam firstCleat = m_Joint.CreateStraightBeam(m_sProfType, m_sProfSize, (Role)spRole, ptCleatStart, ptCleatEnd, csCleat);
if (firstCleat != null)
{
firstCleat.refAxis = eProfRefAxis.kLowerLeft;
createdObjectsArr.Add(firstCleat);
//We will move the cleat cs to create the second cleat, therefore save it, for later when we create the bolts
ICS3d csBolts = (ICS3d)(new DSCGEOMCOMLib.CS3d());
csBolts.setFrom(csCleat);
//Perform calculations for the second cleat
IPoint3d ptBoltsOrig = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
ptBoltsOrig.setFrom(ptCleatStart);
MovePoint(ptBoltsOrig, vectLBeamDir, 100, out ptBoltsOrig);
csBolts.Origin = ptBoltsOrig;
MovePoint(ptCleatEnd, vectLBeamTranslationY, dBeamWeb, out ptCleatEnd);
MovePoint(ptCleatStart, vectLBeamTranslationY, dBeamWeb, out ptCleatStart);
ICS3d csCleat2 = (ICS3d)(new DSCGEOMCOMLib.CS3d());
csCleat2.setFrom(csBeamAtIntersectionPoint);
csCleat2.RotateCSAroundZ(Math.PI);
csCleat2.Origin = ptCleatStart;
//Create the cleat
IStraightBeam secondCleat = m_Joint.CreateStraightBeam(m_sProfType, m_sProfSize, (Role)spRole, ptCleatEnd, ptCleatStart, csCleat);
if (secondCleat != null)
{
//Now connect the L shaped beams with bolts on the main column and beam
secondCleat.refAxis = eProfRefAxis.kLowerLeft;
createdObjectsArr.Add(secondCleat);
CreateBoltPattern("Bolt#1", 100, 60, 3, 2, csBolts, firstCleat, secondCleat, inputColumn, ref createdObjectsArr);
csBolts.RotateCSAroundX(Math.PI / 2);
IPoint3d ptCsBoltOrig = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
MovePoint(csBolts.Origin, vectLBeamTranslationX, -50, out ptCsBoltOrig);
MovePoint(ptCsBoltOrig, vectLBeamTranslationY, 40, out ptCsBoltOrig);
csBolts.Origin = ptCsBoltOrig;
CreateBoltPattern("Bolt#2", 50, 60, 3, 1, csBolts, firstCleat, secondCleat, inputBeam, ref createdObjectsArr);
}
}
}
}
}
catch (COMException ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
bCreationStatus = false;
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
bCreationStatus = false;
}
m_Joint.CreationStatus = bCreationStatus;
m_Joint.CreatedObjects = createdObjectsArr;
}
public void GetUserPages(RulePageArray pagesRet, PropertySheetData pPropSheetData)
{
//Set Title(From AstCrtlDb)
pPropSheetData.SheetPrompt = 88270;
//First Page bitmap index(From AstorBitmaps)
pPropSheetData.FirstPageBitmapIndex = 60782;
pPropSheetData.ResizeOption = eGUIDimension.kStandard;
//Property Sheet 1
RulePage rulePage1 = m_Joint.CreateRulePage();
rulePage1.title = 88438; //Base plate layout
m_GUI = new SampleClipUI(this);
rulePage1.hWnd = m_GUI.Handle.ToInt64();
pagesRet.Add(rulePage1);
}
public void FreeUserPages()
{
m_GUI.Close();
m_GUI.Dispose();
}
public void GetExportData(IRuleExportFiler pExportFiler)
{
}
public bool GetFeatureName(ref string FeatureName)
{
FeatureName = "";
return false;
}
public void InvalidFeature(int reserved)
{
}
public bool ConvertFromHRL(HRLConvertFiler filer, string OldHRLRuleName)
{
return false;
}
public Joint Joint
{
set
{
m_Joint = value;
}
get
{
return m_Joint;
}
}
}
}
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{8CFF2BFD-0E4D-4A20-95F4-C1FD4BDF0703}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleClipAngle</RootNamespace>
<AssemblyName>SampleClipAngle</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
<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>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="ASRepository">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(ASInstallDir)\ASRepository.dll</HintPath>
</Reference>
<Reference Include="DotNetRoots">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(ASInstallDir)\DotNetRoots.dll</HintPath>
</Reference>
<Reference Include="Autodesk.SteelConnections.ASRvtModeler">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(ASInstallDir)\Autodesk.SteelConnections.ASRvtModeler.dll</HintPath>
</Reference>
<Reference Include="AxInterop.ASTCONTROLSLib">
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
<HintPath>$(ASInstallDir)\AxInterop.ASTCONTROLSLib.dll</HintPath>
</Reference>
<Reference Include="Interop.AstSTEELAUTOMATIONLib5">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>$(ASInstallDir)\Interop.AstSTEELAUTOMATIONLib5.dll</HintPath>
</Reference>
<Reference Include="Interop.DSCGEOMCOMLib">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>$(ASInstallDir)\Interop.DSCGEOMCOMLib.dll</HintPath>
</Reference>
<Reference Include="Interop.DSCODBCCOMLib">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>$(ASInstallDir)\Interop.DSCODBCCOMLib.dll</HintPath>
</Reference>
<Reference Include="Interop.DSCPROFILESACCESSCOMLib">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>$(ASInstallDir)\Interop.DSCPROFILESACCESSCOMLib.dll</HintPath>
</Reference>
<Reference Include="Interop.DSCRootsCOMLib">
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>$(ASInstallDir)\Interop.DSCRootsCOMLib.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.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SampleClipAngle.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SampleClipUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SampleClipUI.Designer.cs">
<DependentUpon>SampleClipUI.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="SampleClipUI.resx">
<DependentUpon>SampleClipUI.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,154 @@
namespace SampleClipAngle
{
partial class SampleClipUI
{
/// <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 Windows Form 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(SampleClipUI));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.axAstComboProfile1 = new AxASTCONTROLSLib.AxAstComboProfile();
this.axBoltStandards1 = new AxASTCONTROLSLib.AxBoltStandards();
this.axAstBMP1 = new AxASTCONTROLSLib.AxAstControls();
((System.ComponentModel.ISupportInitialize)(this.axAstComboProfile1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axBoltStandards1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axAstBMP1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(11, 11);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Cleat profile";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 37);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Bolt Diameter";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 62);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(52, 13);
this.label3.TabIndex = 2;
this.label3.Text = "Bolt Type";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(10, 87);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(57, 13);
this.label4.TabIndex = 3;
this.label4.Text = "Bolt Grade";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(10, 109);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(72, 13);
this.label5.TabIndex = 4;
this.label5.Text = "Bolt Assembly";
//
// axAstComboProfile1
//
this.axAstComboProfile1.Location = new System.Drawing.Point(89, 11);
this.axAstComboProfile1.Name = "axAstComboProfile1";
this.axAstComboProfile1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axAstComboProfile1.OcxState")));
this.axAstComboProfile1.Size = new System.Drawing.Size(221, 100);
this.axAstComboProfile1.TabIndex = 5;
this.axAstComboProfile1.ProfileChanged += new System.EventHandler(this.axAstComboProfile1_ProfileChanged);
//
// axBoltStandards1
//
this.axBoltStandards1.Location = new System.Drawing.Point(89, 37);
this.axBoltStandards1.Name = "axBoltStandards1";
this.axBoltStandards1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axBoltStandards1.OcxState")));
this.axBoltStandards1.Size = new System.Drawing.Size(221, 202);
this.axBoltStandards1.TabIndex = 6;
this.axBoltStandards1.BoltChanged += new System.EventHandler(this.axBoltStandards1_BoltChanged);
//
// axAstBMP1
//
this.axAstBMP1.Location = new System.Drawing.Point(316, 11);
this.axAstBMP1.Name = "axAstBMP1";
this.axAstBMP1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axAstBMP1.OcxState")));
this.axAstBMP1.Size = new System.Drawing.Size(200, 200);
this.axAstBMP1.TabIndex = 7;
//
// SampleClipUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(529, 255);
this.Controls.Add(this.axBoltStandards1);
this.Controls.Add(this.axAstComboProfile1);
this.Controls.Add(this.axAstBMP1);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "SampleClipUI";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "SampleClipUI";
((System.ComponentModel.ISupportInitialize)(this.axAstComboProfile1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.axBoltStandards1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.axAstBMP1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private AxASTCONTROLSLib.AxBoltStandards axBoltStandards1;
private AxASTCONTROLSLib.AxAstComboProfile axAstComboProfile1;
private AxASTCONTROLSLib.AxAstControls axAstBMP1;
}
}
@@ -0,0 +1,102 @@
using AstSTEELAUTOMATIONLib;
using Autodesk.AdvanceSteel.DotNetRoots;
using System;
using System.Windows.Forms;
namespace SampleClipAngle
{
public partial class SampleClipUI : Form
{
private const int WS_CHILD = 0x40000000;
private SampleClipAngle m_pCurRule;
private bool m_bIsInitialising = true;
public SampleClipUI(SampleClipAngle clipAngleRule)
{
InitializeComponent();
axAstComboProfile1.Location = AstDpi.Scale(axAstComboProfile1.Location);
axBoltStandards1.Location = AstDpi.Scale(axBoltStandards1.Location);
axAstBMP1.Location = AstDpi.Scale(axAstBMP1.Location);
m_pCurRule = clipAngleRule;
axAstComboProfile1.CurrentProfileName = "AISC 15.0 Angle equal#@§@#L4X4X3/8";
axAstComboProfile1.UseFilterClass = true;
axAstComboProfile1.ShowHideAllSections = true;
axAstComboProfile1.AppendAcceptedClassGroup("W");
axAstComboProfile1.CurrentClass = m_pCurRule.m_sProfType;
axAstComboProfile1.CurrentSection = m_pCurRule.m_sProfSize;
axBoltStandards1.BoltStandard = m_pCurRule.m_sBoltsStandard;
axBoltStandards1.BoltMaterial = m_pCurRule.m_sBoltsMaterial;
axBoltStandards1.BoltSet = m_pCurRule.m_sBoltsSet;
axBoltStandards1.BoltDiameter = m_pCurRule.m_dBoltsDiameter;
m_bIsInitialising = false;
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style = cp.Style | WS_CHILD;
return cp;
}
}
private void axAstComboProfile1_ProfileChanged(object sender, EventArgs e)
{
if (!m_bIsInitialising && m_pCurRule != null)
{
IJoint curJoint = m_pCurRule.Joint;
if (!axAstComboProfile1.Enabled)
{
return;
}
if (m_pCurRule.m_sProfType != axAstComboProfile1.CurrentClass ||
m_pCurRule.m_sProfSize != axAstComboProfile1.CurrentSection)
{
m_pCurRule.m_sProfType = axAstComboProfile1.CurrentClass;
m_pCurRule.m_sProfSize = axAstComboProfile1.CurrentSection;
curJoint.SaveData(m_pCurRule);
curJoint.UpdateDrivenConstruction();
}
}
}
private void axBoltStandards1_BoltChanged(object sender, EventArgs e)
{
if (!m_bIsInitialising && m_pCurRule != null)
{
IJoint curJoint = m_pCurRule.Joint;
double tempValueDiameter = axBoltStandards1.BoltDiameter;
string tempValueGrade = axBoltStandards1.BoltMaterial;
string tempValueAssembly = axBoltStandards1.BoltSet;
string tempValueType = axBoltStandards1.BoltStandard;
string jointGrade = m_pCurRule.m_sBoltsMaterial;
string jointAssembly = m_pCurRule.m_sBoltsSet;
string jointType = m_pCurRule.m_sBoltsStandard;
if ((tempValueDiameter != m_pCurRule.m_dBoltsDiameter) ||
(tempValueGrade != jointGrade) ||
(tempValueAssembly != jointAssembly) ||
(tempValueType != jointType))
{
m_pCurRule.m_dBoltsDiameter = tempValueDiameter;
m_pCurRule.m_sBoltsMaterial = tempValueGrade;
m_pCurRule.m_sBoltsSet = tempValueAssembly;
m_pCurRule.m_sBoltsStandard = tempValueType;
curJoint.SaveData(m_pCurRule);
curJoint.UpdateDrivenConstruction();
}
}
}
}
}
@@ -0,0 +1,149 @@
<?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="axBoltStandards1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAUQAAAAIB
AAAAAQAAAAAAAAAAAAAAADwAAAADAAEA1xYAAHAKAABEAAAA/wEAAAAA/////////////////////wAA
AAAAAAAAAAD//v8A//7/AP/+/wAL
</value>
</data>
<data name="axAstComboProfile1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAA/wAAAAIB
AAAAAQAAAAAAAAAAAAAAAOoAAAADAAEA1xYAACsFAABEAAAAAANS4wuRj84RneMAqgBLuFEBAAAAkAFE
QgEAFE1pY3Jvc29mdCBTYW5zIFNlcmlmAQD//v8iQQBJAFMAQwAgADEANQAuADAAIABBAG4AZwBsAGUA
IABlAHEAdQBhAGwAIwBAAKcAQAAjAEwANABYADQAWAAzAC8AOAD//v8VQQBJAFMAQwAgADEANQAuADAA
IABBAG4AZwBsAGUAIABlAHEAdQBhAGwA//7/CEwANABYADQAWAAzAC8AOAAAZQAAAGYAAABoAAAAAP//
//8AAB4AAAAAAAAAAAAL
</value>
</data>
<data name="axAstBMP1.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAKgAAAAIB
AAAAAQAAAAAAAAAAAAAAABUAAAADAAEAVgoAAFYKAABAAAAAAVfrAAAL
</value>
</data>
</root>