├── D4ASCopyright.docx
├── tools
└── Extra
│ ├── W16_DYNADST_launch.ico
│ ├── DynamoAdvanceSteel.cuix
│ └── DynamoAdvanceSteel.xml
├── src
├── .editorconfig
├── ContentBuilder
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── App.config
│ ├── Program.cs
│ ├── ContentBuilder.csproj
│ └── DocClasses.cs
├── AdvanceSteelServices
│ ├── IContextManager.cs
│ ├── AsServices.csproj.vspscc
│ ├── IAppInteraction.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── DisposeLogic.cs
│ ├── DocContext.cs
│ ├── SerializableHandle.cs
│ ├── ElementBinder.cs
│ ├── AdvanceSteelServices.csproj
│ ├── AppResolver.cs
│ └── LifecycleManager.cs
├── AdvanceSteelNodes
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── base
│ │ ├── SteelDynObject.cs
│ │ ├── GraphicObject.cs
│ │ └── SteelDbObject.cs
│ ├── Util
│ │ ├── Material.cs
│ │ ├── BeamSection.cs
│ │ ├── SelectionFilter.cs
│ │ └── UserAttribute.cs
│ ├── Grating
│ │ ├── GratingDraw.cs
│ │ └── BarGrating.cs
│ ├── AdvanceSteelNodes.csproj
│ └── ConnectionObjects
│ │ ├── WeldLine.cs
│ │ ├── WeldPoint.cs
│ │ └── ConnectionObject.cs
├── AdvanceSteelNodesUI
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Base
│ │ └── AstDropDownBase.cs
│ ├── SteelElements
│ │ ├── ASPropertiesPlate.cs
│ │ ├── ASPropertiesGrating.cs
│ │ ├── ASPropertiesSlab.cs
│ │ ├── ASPropertiesWall.cs
│ │ ├── ASPropertiesBentBeam.cs
│ │ ├── ASPropertiesPolyBeam.cs
│ │ ├── ASPropertiesTaperedBeam.cs
│ │ ├── ASPropertiesStraightBeam.cs
│ │ ├── ASPropertiesUnfoldedBeam.cs
│ │ ├── ASPropertiesConcBentBeam.cs
│ │ ├── ASObjectTypes.cs
│ │ ├── ASPropertiesIsolatedFooting.cs
│ │ ├── ASPropertiesConcStraightBeam.cs
│ │ ├── ASPropertiesCompoundStraightBeam.cs
│ │ └── BeamRefAxisTypeDropDown.cs
│ ├── Miscellaneous
│ │ ├── ASPropertiesCamera.cs
│ │ ├── ASPropertiesSpecialParts.cs
│ │ ├── BodyResolution.cs
│ │ ├── ASSelectObjectTypes.cs
│ │ ├── SteelSelection.cs
│ │ └── ASobjectSelection.cs
│ ├── Features
│ │ ├── ASPropertiesHoles.cs
│ │ ├── ASPropertiesBeamNotchSqFeatures.cs
│ │ ├── ASPropertiesPlateVertexFeatures.cs
│ │ ├── ASPropertiesBeamCutPlaneFeatures.cs
│ │ ├── ASPropertiesBeamNotchExFeatures.cs
│ │ ├── ASPropertiesBeamPolylineNotchFeatures.cs
│ │ ├── ASPropertiesPlatePolylineNotchFeatures.cs
│ │ ├── HoleDirectionDropDown.cs
│ │ ├── PlateFilletVertexTypeDropDown.cs
│ │ └── HoleTypeDropDown.cs
│ ├── ConnectionObjects
│ │ ├── WeldConnectionTypeDropDown.cs
│ │ ├── ASPropertiesWeldLine.cs
│ │ ├── ASPropertiesShearStuds.cs
│ │ ├── ASPropertiesWeldPoint.cs
│ │ ├── ASPropertiesAnchorBolt.cs
│ │ ├── ASPropertiesMidScrewBoltPattern.cs
│ │ ├── ASPropertiesCircleScrewBoltPattern.cs
│ │ ├── BoltConnectionTypeDropDown.cs
│ │ └── AnchorOrientationTypeDropDown.cs
│ └── AdvanceSteelNodesUI.csproj
├── AssemblySharedInfoGenerator
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── AssemblyInfoGenerator.csproj
│ └── AssemblySharedInfo.tt
├── DynamoAdvanceSteel
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SteelAppResolver.cs
│ ├── SchedulerThread.cs
│ ├── RibbonUtils.cs
│ ├── OneTransactionPerContext.cs
│ ├── SteelAppInteraction.cs
│ ├── WorkspaceMigrations.cs
│ ├── DynamoSteelModel.cs
│ ├── DynamoSteelApp.cs
│ ├── OneTransactionPerAllContexts.cs
│ ├── SteelAuthProvider.cs
│ ├── PathResolver.cs
│ └── DynamoAdvanceSteel.csproj
├── Config
│ ├── user_local.props
│ ├── CS.props
│ └── Install.props
├── DynamoAdvanceSteelInstall.sln
├── DynamoAdvanceSteelInstall
│ ├── DirectoryTree.wxs
│ ├── Product.wxs
│ └── DynamoAdvanceSteelInstall.wixproj
├── transform_all.bat
└── DynamoAdvanceSteel.sln
├── Directory.Build.props
├── .gitignore
└── readme.md
/D4ASCopyright.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DynamoDS/Dynamo-Advance-Steel/HEAD/D4ASCopyright.docx
--------------------------------------------------------------------------------
/tools/Extra/W16_DYNADST_launch.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DynamoDS/Dynamo-Advance-Steel/HEAD/tools/Extra/W16_DYNADST_launch.ico
--------------------------------------------------------------------------------
/tools/Extra/DynamoAdvanceSteel.cuix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DynamoDS/Dynamo-Advance-Steel/HEAD/tools/Extra/DynamoAdvanceSteel.cuix
--------------------------------------------------------------------------------
/src/.editorconfig:
--------------------------------------------------------------------------------
1 | # To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2 |
3 | [*.{cs,csx,vb,vbx}]
4 | indent_style = space
5 | indent_size = 2
6 | tab_width = 2
7 |
8 |
--------------------------------------------------------------------------------
/src/ContentBuilder/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("ContentBuilder")]
5 | [assembly: AssemblyCulture("")]
6 | [assembly: Guid("7BD2BAB8-FACE-4058-BE0F-C1906276B74C")]
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/IContextManager.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Dynamo.Applications.AdvanceSteel.Services
3 | {
4 | public interface IContextManager
5 | {
6 | void EnsureInContext(DocContext ctx);
7 | void LeaveContext(DocContext ctx);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/ContentBuilder/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(SolutionDir)..\bin\$(Platform)\$(Configuration)\int\
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.dll
2 | *.pdb
3 | *.cache
4 | *.wixobj
5 | Temporary*.*
6 |
7 | # User-specific files
8 | *.suo
9 | *.db
10 | *.sdf
11 | *.user
12 | *.mnr
13 | *.exe
14 | *.msi
15 | src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
16 | src/.vs/
17 |
18 | # Folders
19 | [Bb]in/
20 | [Oo]bj/
21 | [Ll]og/
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/AsServices.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("AdvanceSteelNodes")]
8 | [assembly: AssemblyCulture("")]
9 | [assembly: Guid("A03C641C-D7A6-43B3-A40B-CC4AE4414073")]
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("AdvanceSteelNodesUI")]
8 | [assembly: AssemblyCulture("")]
9 | [assembly: Guid("907B9532-7437-441A-8EF7-744D34A73B2F")]
--------------------------------------------------------------------------------
/src/AssemblySharedInfoGenerator/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 |
8 | [assembly: AssemblyTitle("AssemblyInfoGenerator")]
9 | [assembly: AssemblyCulture("")]
10 | [assembly: Guid("ee3f94ae-5b7c-4853-a26b-082ece99ed66")]
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("DynamoAdvanceSteel")]
8 |
9 | // The following GUID is for the ID of the typelib if this project is exposed to COM
10 | [assembly: Guid("7649e0ff-ebed-4cee-9b0b-f74c3649590b")]
--------------------------------------------------------------------------------
/tools/Extra/DynamoAdvanceSteel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | DynamoAdvanceSteel.dll
7 | DynamoAdvanceSteel.cuix
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/IAppInteraction.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.DotNetRoots.Units;
2 | using Autodesk.AdvanceSteel.Geometry;
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | namespace Dynamo.Applications.AdvanceSteel.Services
7 | {
8 | public interface IAppInteraction
9 | {
10 | event EventHandler DocumentOpened;
11 | UnitsSet DbUnits { get; }
12 | IEnumerable PickElements();
13 | IEnumerable GetCurrentSelection();
14 | void ExecuteOnIdle(Action a);
15 | Point3d PickPoint();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Config/user_local.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | D:\DynamoCoreRuntime3.4.2
5 | C:\Program Files\Autodesk\AutoCAD 2026\ADVS
6 | C:\Program Files\Autodesk\AutoCAD 2026
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AdvanceSteelServices")]
9 | [assembly: AssemblyCulture("")]
10 | [assembly: Guid("E8A8CD40-6E78-4C8C-9992-2346D09DF866")]
11 | [assembly: InternalsVisibleTo("DynamoSteelTests")]
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/SteelAppResolver.cs:
--------------------------------------------------------------------------------
1 | using Dynamo.Applications.AdvanceSteel.Services;
2 |
3 | namespace Dynamo.Applications.AdvanceSteel
4 | {
5 | public class SteelAppResolver : AppResolver
6 | {
7 | public override T ResolveType()
8 | {
9 | if (typeof(T) == typeof(IContextManager))
10 | return new OneTransactionPerAllContexts() as T;
11 | //return new OneTransactionPerContext() as T;
12 |
13 | if (typeof(T) == typeof(IAppInteraction))
14 | return new SteelAppInteraction() as T;
15 |
16 | return null;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Base/AstDropDownBase.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.DesignScript.Runtime;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Newtonsoft.Json;
5 | using System.Collections.Generic;
6 |
7 | namespace AdvanceSteel.Nodes
8 | {
9 | public abstract class AstDropDownBase : DSDropDownBase
10 | {
11 | protected AstDropDownBase(string value) : base(value)
12 | {
13 | }
14 |
15 | [JsonConstructor]
16 | public AstDropDownBase(string value, IEnumerable inPorts, IEnumerable outPorts) : base(value, inPorts, outPorts)
17 | {
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/base/SteelDynObject.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.DesignScript.Interfaces;
2 | using Autodesk.DesignScript.Runtime;
3 | using System;
4 | using Dynamo.Applications.AdvanceSteel.Services;
5 |
6 | namespace AdvanceSteel.Nodes
7 | {
8 | ///
9 | /// This is the equivalent of an Advance Steel object in Dynamo
10 | ///
11 | [IsVisibleInDynamoLibrary(false)]
12 | public abstract class SteelDynObject : IDisposable, IFormattable
13 | {
14 | [IsVisibleInDynamoLibrary(false)]
15 | public abstract void Dispose();
16 |
17 |
18 | [IsVisibleInDynamoLibrary(false)]
19 | public override string ToString()
20 | {
21 | return GetType().Name;
22 | }
23 |
24 | public virtual string ToString(string format, IFormatProvider formatProvider)
25 | {
26 | return ToString();
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/DisposeLogic.cs:
--------------------------------------------------------------------------------
1 | namespace Dynamo.Applications.AdvanceSteel.Services
2 | {
3 | public static class DisposeLogic
4 | {
5 | ///
6 | /// This flag is set to true in the event that you want to
7 | /// notify IDisposable objects whether Dynamo is shutting down.
8 | /// Ex. When shutting down Advance Steel, we set IsShuttingDown to true,
9 | /// and we read this flag in the Dispose method. For AbstractElement
10 | /// elements this allows us to bypass cleanup of Advance Steel elements.
11 | ///
12 | public static bool IsShuttingDown { get; set; }
13 |
14 | ///
15 | /// This flag is set to true when Dynamo is going to close
16 | /// current home workspace and set to false when home workspace is
17 | /// removed.
18 | ///
19 | public static bool IsClosingHomeworkspace { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/ContentBuilder/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Reflection;
5 |
6 | namespace ContentBuilder
7 | {
8 | class Program
9 | {
10 | static void Main(string[] args)
11 | {
12 | if (args.Length != 2)
13 | {
14 | Console.WriteLine("Expect:");
15 | Console.WriteLine("1. directory path to generated XML Documentation files");
16 | Console.WriteLine("2. full path to .md file to update");
17 | return;
18 | }
19 |
20 | string strFullAssemblyDocDir = args[0]; // full path to assembly documentation file ( xml)
21 | string strFullDocName = args[1]; // full path to .md that will be created
22 |
23 |
24 | var nodes = NodeParser.GetNodesFromAssemblies(new string[] { "AdvanceSteelNodes.dll", "AdvanceSteelNodesUI.dll" });
25 | MDGenerator.GenerateFromAssembly(strFullAssemblyDocDir, nodes, strFullDocName);
26 |
27 |
28 |
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/SchedulerThread.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AutoCAD.ApplicationServices.Core;
2 | using Dynamo.Scheduler;
3 | using System;
4 |
5 | namespace Dynamo.Applications.AdvanceSteel
6 | {
7 | ///
8 | /// class used to execute dynamo tasks in AutoCAD application context
9 | ///
10 | public class SchedulerThread : ISchedulerThread
11 | {
12 | private IScheduler Scheduler;
13 |
14 | public void Initialize(IScheduler owningScheduler)
15 | {
16 | Scheduler = owningScheduler;
17 | Application.Idle += Application_Idle;
18 | }
19 |
20 | private void Application_Idle(object sender, EventArgs e)
21 | {
22 | Application.DocumentManager.ExecuteInApplicationContext(ExecuteInApplicationContextCallback, null);
23 | }
24 |
25 | public void ExecuteInApplicationContextCallback(object userData)
26 | {
27 | while (Scheduler.ProcessNextTask(false))
28 | {
29 | }
30 | }
31 |
32 | public void Shutdown()
33 | {
34 | Application.Idle -= Application_Idle;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/DocContext.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.DocumentManagement;
2 | using System;
3 | using System.Reflection;
4 |
5 | namespace Dynamo.Applications.AdvanceSteel.Services
6 | {
7 | ///
8 | /// Used to manage the transactions while accessing Advance Steel objects
9 | ///
10 | public class DocContext : IDisposable
11 | {
12 | private bool readOnly = false;
13 |
14 | public DocContext(bool readOnly = false)
15 | {
16 | this.readOnly = readOnly;
17 | Manager.EnsureInContext(this);
18 | }
19 |
20 | public void Dispose()
21 | {
22 | Manager.LeaveContext(this);
23 | }
24 | public static IContextManager Manager
25 | {
26 | get
27 | {
28 | if (manager == null)
29 | {
30 | manager = AppResolver.Resolve();
31 | }
32 |
33 | return manager;
34 | }
35 | }
36 |
37 | public bool ReadOnly
38 | {
39 | get
40 | {
41 | return readOnly;
42 | }
43 | set
44 | {
45 | readOnly = value;
46 | }
47 | }
48 |
49 | private static IContextManager manager;
50 | }
51 | }
--------------------------------------------------------------------------------
/src/AssemblySharedInfoGenerator/AssemblyInfoGenerator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | true
7 | true
8 | false
9 | {133FC760-5699-46D9-BEA6-E816B5F01016}
10 | false
11 |
12 |
13 | "$(SolutionDir)transform_all.bat" "$(MSBuildProjectDirectory)"
14 |
15 |
16 |
17 | True
18 | True
19 | AssemblySharedInfo.tt
20 |
21 |
22 |
23 |
24 | TextTemplatingFileGenerator
25 | AssemblySharedInfo.cs
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteelInstall.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.705
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "DynamoAdvanceSteelInstall", "DynamoAdvanceSteelInstall\DynamoAdvanceSteelInstall.wixproj", "{C7495640-0D0C-46AB-A5F3-D5BE78F89A0D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x86 = Debug|x86
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C7495640-0D0C-46AB-A5F3-D5BE78F89A0D}.Debug|x86.ActiveCfg = Debug|x86
15 | {C7495640-0D0C-46AB-A5F3-D5BE78F89A0D}.Debug|x86.Build.0 = Debug|x86
16 | {C7495640-0D0C-46AB-A5F3-D5BE78F89A0D}.Release|x86.ActiveCfg = Release|x86
17 | {C7495640-0D0C-46AB-A5F3-D5BE78F89A0D}.Release|x86.Build.0 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {E83005B6-2B1A-46F5-8C69-9E1CA73DBC86}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/RibbonUtils.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.Windows;
2 | using System.Runtime.Versioning;
3 |
4 | namespace Dynamo.Applications.AdvanceSteel
5 | {
6 | [SupportedOSPlatform("windows")]
7 | public class RibbonUtils
8 | {
9 | public static string DynamoASTabUID = "Add-ins";
10 | public static string DynamoASPanelUID = "ID_PanelOnlineDocuments";
11 | public static string DynamoASButtonUID = "DYNAMOAS";
12 |
13 | public static void SetEnabled(string tabName, string panelUID, string buttonUID, bool enabled)
14 | {
15 | RibbonTabCollection oTabs = Autodesk.Windows.ComponentManager.Ribbon.Tabs;
16 | foreach (RibbonTab oTab in oTabs)
17 | {
18 | if (oTab.Title == tabName)
19 | {
20 | RibbonPanelCollection bPans = oTab.Panels;
21 |
22 | foreach (RibbonPanel oPanel in bPans)
23 | {
24 | if (oPanel.UID == panelUID)
25 | {
26 | foreach (RibbonItem item in oPanel.Source.Items)
27 | {
28 | if (item.UID == buttonUID)
29 | {
30 | item.IsEnabled = enabled;
31 | }
32 | }
33 | }
34 | }
35 | break;
36 | }
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/SerializableHandle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.Serialization;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace Dynamo.Applications.AdvanceSteel.Services
9 | {
10 | ///
11 | /// Holds a representation of a AutoCAD Handle that supports serialization
12 | ///
13 | [Serializable]
14 | public class SerializableHandle : ISerializable
15 | {
16 | public string Handle { get; set; }
17 |
18 | public SerializableHandle()
19 | {
20 | Handle = "";
21 | }
22 |
23 | ///
24 | /// Ctor used by the serialization engine
25 | ///
26 | ///
27 | ///
28 | public SerializableHandle(SerializationInfo info, StreamingContext context)
29 | {
30 | Handle = (string)info.GetValue("Handle", typeof(string));
31 | }
32 | ///
33 | /// Populates a System.Runtime.Serialization.SerializationInfo with the data needed
34 | ///
35 | ///
36 | ///
37 | public void GetObjectData(SerializationInfo info, StreamingContext context)
38 | {
39 | info.AddValue("Handle", Handle, typeof(string));
40 | }
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/ElementBinder.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.CADAccess;
2 | using System;
3 | using System.Runtime.Serialization;
4 |
5 | namespace Dynamo.Applications.AdvanceSteel.Services
6 | {
7 | ///
8 | /// Tools to handle the binding and interaction
9 | ///
10 | public class ElementBinder
11 | {
12 | //maybe we need a separate key for Advance Steel
13 | //for the moment dynamo is using only this hardcoded key (see ..\Dynamo\src\Engine\ProtoCore\Lang\TraceUtils.cs)
14 | private const string REVIT_TRACE_ID = "{0459D869-0C72-447F-96D8-08A7FB92214B}-REVIT";
15 |
16 | public static string GetHandleFromTrace()
17 | {
18 | string traceData = DynamoServices.TraceUtils.GetTraceData(REVIT_TRACE_ID);
19 |
20 | if (traceData == null)
21 | return null; //There was no usable data in the trace cache
22 |
23 | return traceData;
24 | }
25 |
26 | public static void SetElementForTrace(string handle)
27 | {
28 | DynamoServices.TraceUtils.SetTraceData(REVIT_TRACE_ID, handle);
29 | }
30 |
31 | public static void CleanupAndSetElementForTrace(FilerObject newElement)
32 | {
33 | if (newElement == null) return;
34 |
35 | var oldHandle = GetHandleFromTrace();
36 | if (oldHandle != null && oldHandle != newElement.Handle)
37 | {
38 | //right now do not delete anything
39 | //
40 | }
41 |
42 | SetElementForTrace(newElement.Handle);
43 | }
44 | }
45 | }
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/OneTransactionPerContext.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Dynamo.Applications.AdvanceSteel.Services;
7 | using Autodesk.AdvanceSteel.DocumentManagement;
8 |
9 | namespace Dynamo.Applications.AdvanceSteel
10 | {
11 | public class OneTransactionPerContext : IContextManager
12 | {
13 | private Autodesk.AdvanceSteel.CADAccess.Transaction SteelTransaction = null;
14 | private bool DocumentLocked = false;
15 |
16 | public void EnsureInContext(DocContext ctx)
17 | {
18 | if (SteelTransaction != null || DocumentLocked == true)
19 | throw new System.Exception("Nested context");
20 |
21 | DocumentLocked = DocumentManager.LockCurrentDocument();
22 |
23 | if (DocumentLocked == true)
24 | {
25 | SteelTransaction = Autodesk.AdvanceSteel.CADAccess.TransactionManager.StartTransaction();
26 | }
27 |
28 | if (DocumentLocked == false || SteelTransaction == null)
29 | {
30 | throw new System.Exception("Failed to access Document");
31 | }
32 | }
33 |
34 | public void LeaveContext(DocContext ctx)
35 | {
36 | if (SteelTransaction != null)
37 | {
38 | SteelTransaction.Commit();
39 | SteelTransaction = null;
40 | }
41 |
42 | if (DocumentLocked == true)
43 | {
44 | DocumentLocked = DocumentManager.UnlockCurrentDocument();
45 | DocumentLocked = false;
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/Util/Material.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.CADAccess;
2 | using Autodesk.AdvanceSteel.ConstructionTypes;
3 | using System;
4 | using SteelServices = Dynamo.Applications.AdvanceSteel.Services;
5 |
6 | namespace AdvanceSteel.Nodes.Util
7 | {
8 | ///
9 | /// This node can be used to assign Material to Advance Steel elements from Dynamo
10 | ///
11 | public class Material
12 | {
13 | internal Material()
14 | {
15 | }
16 | ///
17 | /// This node can set the Material for Advance Steel elements from Dynamo
18 | ///
19 | /// Advance Steel element
20 | /// Material
21 | ///
22 | [Obsolete("Material.SetMaterial is obsolete. Please use Property.ByNameAndValue with name \"Material\" and the desired material value, followed by Property.SetObjectProperty.")]
23 | public static void SetMaterial(AdvanceSteel.Nodes.SteelDbObject element, string materialName)
24 | {
25 | //lock the document and start transaction
26 | using (var ctx = new SteelServices.DocContext())
27 | {
28 | string handle = element.Handle;
29 |
30 | FilerObject obj = Utils.GetObject(handle);
31 |
32 | if (obj != null && obj.IsKindOf(FilerObject.eObjectType.kAtomicElem))
33 | {
34 | AtomicElement atomic = obj as AtomicElement;
35 | atomic.Material = materialName;
36 | }
37 | else
38 | throw new System.Exception("Failed to set material");
39 | }
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/src/ContentBuilder/ContentBuilder.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {00ED013F-0B34-4A79-9760-A21FD14D4BD6}
7 | Exe
8 | false
9 | MSB3277
10 |
11 |
12 |
13 | $(DYNAMOAPI)\Newtonsoft.Json.dll
14 | False
15 |
16 |
17 | $(DYNAMOAPI)\nodes\CoreNodeModels.dll
18 | False
19 |
20 |
21 | $(DYNAMOAPI)\nodes\CoreNodeModelsWpf.dll
22 | False
23 |
24 |
25 | $(DYNAMOAPI)\DynamoApplications.dll
26 | False
27 |
28 |
29 | $(DYNAMOAPI)\DynamoCore.dll
30 | False
31 |
32 |
33 | $(DYNAMOAPI)\DynamoServices.dll
34 | False
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/Grating/GratingDraw.cs:
--------------------------------------------------------------------------------
1 | using AdvanceSteel.Nodes.Plates;
2 | using Autodesk.AdvanceSteel.CADAccess;
3 | using Autodesk.DesignScript.Runtime;
4 | using DynGeometry = Autodesk.DesignScript.Geometry;
5 | using SteelGeometry = Autodesk.AdvanceSteel.Geometry;
6 | using SteelServices = Dynamo.Applications.AdvanceSteel.Services;
7 | using System.Collections.Generic;
8 | using Autodesk.AdvanceSteel.Geometry;
9 | using System.Linq;
10 | using System;
11 |
12 | namespace AdvanceSteel.Nodes.Gratings
13 | {
14 | [IsVisibleInDynamoLibrary(false)]
15 | public static class GratingDraw
16 | {
17 | public static List GetPointsToDraw(Autodesk.AdvanceSteel.Modelling.Grating grating)
18 | {
19 | var coordSystem = grating.CS;
20 | coordSystem.GetCoordSystem(out var origPt, out var vX, out var vY, out var vZ);
21 |
22 | var temp1 = vY * grating.Width / 2.0;
23 | var temp2 = vX * grating.Length / 2.0;
24 |
25 | var pt1 = new SteelGeometry.Point3d(grating.CenterPoint);
26 | pt1.Add(temp1 + temp2);
27 |
28 | var pt2 = new SteelGeometry.Point3d(grating.CenterPoint);
29 | pt2.Add(temp1 - temp2);
30 |
31 | var pt3 = new SteelGeometry.Point3d(grating.CenterPoint);
32 | pt3.Add(-temp1 - temp2);
33 |
34 | var pt4 = new SteelGeometry.Point3d(grating.CenterPoint);
35 | pt4.Add(-temp1 + temp2);
36 |
37 |
38 | List polyPoints = new List
39 | {
40 | Utils.ToDynPoint(pt1, true),
41 | Utils.ToDynPoint(pt2, true),
42 | Utils.ToDynPoint(pt3, true),
43 | Utils.ToDynPoint(pt4, true)
44 | };
45 |
46 | return polyPoints;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteelInstall/DirectoryTree.wxs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/AdvanceSteelServices.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {00ED013F-0B34-4A79-9760-A21FD14D4BD5}
7 | Dynamo.Applications.AdvanceSteel.Services
8 | false
9 | MSB3277
10 |
11 |
12 |
13 | $(ADVANCESTEELAPI)\ASCADLinkMgd.dll
14 | False
15 |
16 |
17 | $(ADVANCESTEELAPI)\ASObjectsMgd.dll
18 | False
19 |
20 |
21 | $(ADVANCESTEELAPI)\Extensions\DotNetRoots.dll
22 | False
23 |
24 |
25 | $(ADVANCESTEELAPI)\ASGeometryMgd.dll
26 | False
27 |
28 |
29 | $(DYNAMOAPI)\DynamoServices.dll
30 | False
31 |
32 |
33 | $(DYNAMOAPI)\DynamoCore.dll
34 | False
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/transform_all.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | SETLOCAL ENABLEDELAYEDEXPANSION
3 |
4 | :: set the working dir (default to current dir)
5 | set wdir=%cd%
6 | if not (%1)==() set wdir=%1
7 |
8 | :: set the file extension (default to vb)
9 | set extension=cs
10 | if not (%2)==() set extension=%2
11 |
12 | echo executing transform_all from %wdir%
13 | pushd %wdir%
14 | :: create a list of all the T4 templates in the working dir
15 | dir *.tt /b > t4list.txt
16 |
17 | echo the following T4 templates will be transformed:
18 | type t4list.txt
19 |
20 | :: Use texttransform.exe from the IDE if it is present, otherwise, use legacy locations.
21 |
22 | :: clear text transform path to undefine it
23 | set TEXTTRANSFORMPATH=
24 |
25 | :: use latest vswhere utility to locate in IDE, where it resides now.
26 | IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
27 | for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -all`) do (
28 | if /i "%%i" == "installationPath" set TEXTTRANSFORMPATH="%%j\Common7\IDE\TextTransform.exe"
29 | )
30 | )
31 |
32 | :: not found in IDE, use legacy
33 | IF NOT DEFINED TEXTTRANSFORMPATH (
34 | set TEXTTRANSFORMPATH="%COMMONPROGRAMFILES(x86)%\microsoft shared\TextTemplating\%VisualStudioVersion%\TextTransform.exe"
35 | )
36 |
37 | :: transform all the templates
38 | for /f %%d in (t4list.txt) do (
39 | set file_name=%%d
40 | set file_name=!file_name:~0,-3!.%extension%
41 | echo: \--^> !file_name!
42 | echo %TEXTTRANSFORMPATH% -out !file_name! %%d
43 | %TEXTTRANSFORMPATH% -out !file_name! %%d
44 | )
45 |
46 | :: delete T4 list and return to previous directory
47 | del t4list.txt
48 | popd
49 |
50 | echo transformation complete
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/SteelAppInteraction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Dynamo.Applications.AdvanceSteel.Services;
7 | using Autodesk.AdvanceSteel.DocumentManagement;
8 | using Autodesk.AdvanceSteel.CADAccess;
9 | using Autodesk.AdvanceSteel.CADLink.Database;
10 | using Autodesk.AdvanceSteel.Geometry;
11 |
12 | namespace Dynamo.Applications.AdvanceSteel
13 | {
14 | class SteelAppInteraction : IAppInteraction
15 | {
16 | public Autodesk.AdvanceSteel.DotNetRoots.Units.UnitsSet DbUnits
17 | {
18 | get { return DocumentManager.GetCurrentDocument().CurrentDatabase.Units; }
19 | }
20 |
21 | public event EventHandler DocumentOpened;
22 |
23 | public void ExecuteOnIdle(Action a)
24 | {
25 | throw new NotImplementedException();
26 | }
27 |
28 | public IEnumerable GetCurrentSelection()
29 | {
30 | throw new NotImplementedException();
31 | }
32 |
33 | public Point3d PickPoint()
34 | {
35 | return UserInteraction.GetPoint("Pick Point: ", 1);
36 | }
37 |
38 |
39 | public IEnumerable PickElements()
40 | {
41 | List ret = new List() { };
42 |
43 | using (var ctx = new DocContext())
44 | {
45 | List OIDx = UserInteraction.SelectObjects();
46 | if (OIDx.Count > 0)
47 | {
48 | for (int i = 0; i < OIDx.Count; i++)
49 | {
50 | FilerObject obj = FilerObject.GetFilerObject(OIDx[i]);
51 | if (obj != null)
52 | {
53 | ret.Add(obj.Handle);
54 | }
55 | }
56 | }
57 | }
58 | return ret;
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/WorkspaceMigrations.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Xml;
4 | using Dynamo.Migration;
5 | using Dynamo.Models;
6 | using Dynamo.Utilities;
7 |
8 | namespace Dynamo.Migration.AdvanceSteel
9 | {
10 | public class WorkspaceMigrations
11 | {
12 | [WorkspaceMigration("0.8.1.0", "1.0.0.0")]
13 | public static void Migrate_0_8_1_to_1_0_0_0(XmlDocument doc)
14 | {
15 | XmlNodeList elNodes = doc.GetElementsByTagName("Elements");
16 |
17 | if (elNodes.Count == 0)
18 | elNodes = doc.GetElementsByTagName("dynElements");
19 |
20 | var elementsRoot = elNodes[0];
21 |
22 | var corrections = new List>();
23 |
24 | foreach (XmlElement elNode in elementsRoot.ChildNodes)
25 | {
26 | if (elNode.Name == "Dynamo.Nodes.DSFunction" && elNode.Attributes["assembly"].Value == "AsNodes.dll")
27 | {
28 | XmlElement newNode = elNode.Clone() as XmlElement;
29 |
30 | string oldFunction = elNode.Attributes["function"].Value;
31 | string newFunction = oldFunction.Replace("AdvanceSteel.Nodes.StraightBeam", "AdvanceSteel.Nodes.Beams.StraightBeam");
32 | newFunction = newFunction.Replace("AdvanceSteel.Nodes.BentBeam", "AdvanceSteel.Nodes.Beams.BentBeam");
33 |
34 | newNode.SetAttribute("assembly", "AdvanceSteelNodes.dll");
35 | newNode.SetAttribute("function", newFunction);
36 | corrections.Add(new Tuple(newNode, elNode));
37 | }
38 |
39 | }
40 |
41 | foreach (var correction in corrections)
42 | {
43 | elementsRoot.InsertBefore(correction.Item1, correction.Item2);
44 | elementsRoot.RemoveChild(correction.Item2);
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/AdvanceSteelServices/AppResolver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Dynamo.Applications.AdvanceSteel.Services
8 | {
9 | public abstract class AppResolver
10 | {
11 | public abstract T ResolveType() where T : class;
12 | public static T Resolve() where T : class
13 | {
14 | return Instance.ResolveType();
15 | }
16 |
17 | internal static AppResolver Instance
18 | {
19 | get
20 | {
21 | if (inst == null)
22 | {
23 | string appName = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName.ToLower();
24 | switch (appName)
25 | {
26 | case "revit.exe":
27 | {
28 | inst = Activator.CreateInstance("DynamoSteelRevit", "Dynamo.Applications.AdvanceSteel.RevitAppResolver").Unwrap() as AppResolver;
29 | break;
30 | }
31 | case "acad.exe":
32 | {
33 | inst = Activator.CreateInstance("DynamoAdvanceSteel", "Dynamo.Applications.AdvanceSteel.SteelAppResolver").Unwrap() as AppResolver;
34 | break;
35 | }
36 | case "vstest.executionengine.exe":
37 | case "testhost.exe":
38 | {
39 | inst = Activator.CreateInstance("DynamoSteelTests", "DynamoSteelTests.TestsAppResolver").Unwrap() as AppResolver;
40 | break;
41 | }
42 | default:
43 | {
44 | break;
45 | }
46 | }
47 | }
48 |
49 | return inst;
50 | }
51 | set
52 | {
53 | inst = value;
54 | }
55 | }
56 |
57 | private static AppResolver inst;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/DynamoSteelModel.cs:
--------------------------------------------------------------------------------
1 | using Dynamo.Graph.Workspaces;
2 | using Dynamo.Migration.AdvanceSteel;
3 | using Dynamo.Models;
4 | using System.Runtime.Versioning;
5 |
6 | namespace Dynamo.Applications.AdvanceSteel
7 | {
8 | [SupportedOSPlatform("windows")]
9 | public class DynamoSteelModel : DynamoModel
10 | {
11 | public new static DynamoSteelModel Start(IStartConfiguration configuration)
12 | {
13 | if (string.IsNullOrEmpty(configuration.Context))
14 | configuration.Context = "Advance Steel";
15 |
16 | return new DynamoSteelModel(configuration);
17 | }
18 |
19 | private DynamoSteelModel(IStartConfiguration configuration) :
20 | base(configuration)
21 | {
22 | Services.DisposeLogic.IsShuttingDown = false;
23 |
24 | MigrationManager.MigrationTargets.Add(typeof(WorkspaceMigrations));
25 | //SetupPython();
26 | }
27 |
28 | protected override void ShutDownCore(bool shutdownHost)
29 | {
30 | Services.DisposeLogic.IsShuttingDown = true;
31 | //Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.DocumentActivationEnabled = true;
32 |
33 | base.ShutDownCore(shutdownHost);
34 |
35 | RibbonUtils.SetEnabled(RibbonUtils.DynamoASTabUID, RibbonUtils.DynamoASPanelUID, RibbonUtils.DynamoASButtonUID, true);
36 | }
37 |
38 | protected override void OnWorkspaceRemoveStarted(WorkspaceModel workspace)
39 | {
40 | base.OnWorkspaceRemoveStarted(workspace);
41 |
42 | if (workspace is HomeWorkspaceModel)
43 | Services.DisposeLogic.IsClosingHomeworkspace = true;
44 | }
45 |
46 | protected override void OnWorkspaceRemoved(WorkspaceModel workspace)
47 | {
48 | base.OnWorkspaceRemoved(workspace);
49 |
50 | if (workspace is HomeWorkspaceModel)
51 | Services.DisposeLogic.IsClosingHomeworkspace = false;
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Dynamo Extension for Advance Steel
2 |
3 | This repository contains the source files for the Dynamo Extension for Advance Steel.
4 |
5 | **Dynamo Extension for Advance Steel** has different branches for different versions of Advance Steel. For example, to run it on Advance Steel 2020 you must use **AS2020_2.1.0** branch.
6 |
7 | ## How to build and use this extension:
8 |
9 | 1. Prerequisites needed:
10 | - Advance Steel 2026;
11 | - Visual Studio 2022;
12 | - Dynamo Core 3.4.2 runtime from http://www.github.com/DynamoDS/Dynamo;
13 | - .NET 8 SDK from https://dotnet.microsoft.com/download/visual-studio-sdks
14 | 1. Update the paths from [`\src\Config\user_local.props`](/src/Config/user_local.props) with the ones on your machine
15 | 1. Build the DynamoAdvanceSteel.sln solution in Release configuration.
16 | 1. Copy all files and folders from "Dynamo Core 3.0.3" build to .\bin\AnyCPU\Release\steel-pkg\bin\Core
17 | 1. (Optional) On Windows 10 version 1709 and later, run the the PowerShell command `Get-ChildItem *.* -Recurse | Unblock-File` inside .\bin\AnyCPU\Release\steel-pkg\bin\Core otherwise Dynamo can fail to load under Advance Steel. This is due to newer Windows blocking .NET assemblies downloaded from the internet.
18 | 1. Register DynamoAdvanceSteel.dll as an addon for Advance Steel (see "Register addon" section from Advance Steel [online help](https://help.autodesk.com/view/ADSTPR/2024/ENU/?guid=GUID-A4DA627E-6680-4388-9C04-79F5F3D9D075#GUID-A4DA627E-6680-4388-9C04-79F5F3D9D075__SECTION_7F1482FDAB9845CC8CEAB9D042201C2A))
19 |
20 | ## To build the installer:
21 |
22 | 1. Prerequisites needed:
23 | - Wix v3.11 or newer;
24 | 1. Build DynamoAdvanceSteel.sln solution in Release configuration;
25 | 1. Build DynamoAdvanceSteelInstall.sln solution in Release configuration;
26 |
27 | ## List of available nodes:
28 |
29 | Click [here](nodes.md) to view the list of the available dynamo-advance steel nodes
30 |
--------------------------------------------------------------------------------
/src/Config/CS.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | net8.0-windows
8 | $(SolutionDir)..\bin\$(Platform)\$(Configuration)\steel-pkg\bin\
9 | $(BaseIntermediateOutputPath)
10 | false
11 | x64
12 | 512
13 | true
14 | full
15 | false
16 | DEBUG;TRACE
17 | prompt
18 | 4
19 | en-US
20 |
21 |
22 | net8.0-windows
23 | $(SolutionDir)..\bin\$(Platform)\$(Configuration)\steel-pkg\bin\
24 | $(BaseIntermediateOutputPath)
25 | false
26 | x64
27 | 512
28 | pdbonly
29 | true
30 | TRACE
31 | prompt
32 | 4
33 | en-US
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteelInstall/Product.wxs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 2026
9 |
10 |
11 |
12 |
13 | 1
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/Config/Install.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 10.0
8 | $(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration)
9 | $(OutputPath)..\..\..\..\..
10 | $(SolutionDir)..
11 | $(SolutionDir)\..\samples
12 | $(InstallOutputPath)\int\
13 | true
14 | full
15 | false
16 | DEBUG;TRACE
17 | prompt
18 | 4
19 |
20 |
21 | 10.0
22 | $(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration)
23 | $(OutputPath)..\..\..\..\..
24 | $(SolutionDir)..
25 | $(SolutionDir)\..\samples
26 | $(InstallOutputPath)\int\
27 | pdbonly
28 | true
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesPlate.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PlateProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Plate")]
12 | [NodeCategory("AdvanceSteel.Nodes.Plates")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesPlate : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesPlate()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesPlate(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetPlatePropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/base/GraphicObject.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.DesignScript.Interfaces;
2 | using Autodesk.DesignScript.Runtime;
3 | using System.Collections.Generic;
4 |
5 | namespace AdvanceSteel.Nodes
6 | {
7 | ///
8 | /// This represents the Advance Steel Objects as graphical objects
9 | ///
10 | [IsVisibleInDynamoLibrary(false)]
11 | public abstract class GraphicObject : SteelDbObject, IGraphicItem
12 | {
13 | private const byte DefR = 101;
14 | private const byte DefG = 86;
15 | private const byte DefB = 130;
16 | private const byte DefA = 255;
17 |
18 | public virtual Autodesk.DesignScript.Geometry.Curve GetDynCurve() { return null; }
19 | public virtual IEnumerable GetDynGeometry() { return new List() { GetDynCurve() }; }
20 |
21 | public new void Tessellate(IRenderPackage package, TessellationParameters parameters)
22 | {
23 | var previousMeshVertexCount = package.MeshVertexCount;
24 | var previousLineVertexCount = package.LineVertexCount;
25 |
26 | foreach (var geometry in GetDynGeometry())
27 | {
28 | if (geometry == null)
29 | continue;
30 |
31 | geometry.Tessellate(package, parameters);
32 | }
33 |
34 | if (package is IRenderPackageSupplement packageSupplement)
35 | {
36 | int size = (package.MeshVertexCount - previousMeshVertexCount) * 4;
37 | packageSupplement.AddTextureMapForMeshVerticesRange(previousMeshVertexCount, package.MeshVertexCount - 1, CreateColorByteArrayOfSize(size, DefR, DefG, DefB, DefA), size);
38 |
39 | if (package.LineVertexCount > previousLineVertexCount)
40 | {
41 | packageSupplement.UpdateLineVertexColorForRange(previousLineVertexCount, package.LineVertexCount - 1, DefR, DefG, DefB, DefA);
42 | }
43 | }
44 | }
45 |
46 | private static byte[] CreateColorByteArrayOfSize(int size, byte red, byte green, byte blue, byte alpha)
47 | {
48 | var arr = new byte[size * 4];
49 | for (var i = 0; i < arr.Length; i += 4)
50 | {
51 | arr[i] = red;
52 | arr[i + 1] = green;
53 | arr[i + 2] = blue;
54 | arr[i + 3] = alpha;
55 | }
56 | return arr;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesGrating.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("GratingProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Grating")]
12 | [NodeCategory("AdvanceSteel.Nodes.Grating")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesGrating : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesGrating()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesGrating(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetGratingPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Miscellaneous/ASPropertiesCamera.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("CameraProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Camera")]
12 | [NodeCategory("AdvanceSteel.Nodes.Miscellaneous.Camera")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesCamera : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesCamera()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesCamera(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetCameraPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesSlab.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ConcreteSlabProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Concrete Slabs")]
12 | [NodeCategory("AdvanceSteel.Nodes.Concrete.Slabs")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesSlab : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesSlab()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesSlab(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetConcreteSlabProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesWall.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ConcreteWallProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Concrete Wall")]
12 | [NodeCategory("AdvanceSteel.Nodes.Concrete.Walls")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesWall: AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesWall()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesWall(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetConcreteWallProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesBentBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BentBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Bent Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.BentBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBentBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesBentBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesBentBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetBentBeamPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesPolyBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PolyBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Poly Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.PolyBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesPolyBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesPolyBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesPolyBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetPolyBeamPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesTaperedBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("TaperedBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Tapered Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.TaperedBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesTaperedBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesTaperedBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesTaperedBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetTaperBeamPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesStraightBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("StraightBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Straight Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.StraightBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesStraightBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesStraightBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesStraightBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetStraighBeamPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesHoles.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PlateHoleProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Holes")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.PlateHoles")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesHoles : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesHoles()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesHoles(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };//
41 | foreach (var item in Utils.GetConnectionHolePlatePropertyList())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Miscellaneous/ASPropertiesSpecialParts.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("SpecialPartsProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Special Part")]
12 | [NodeCategory("AdvanceSteel.Nodes.Miscellaneous.SpecialPart")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesSpecialParts : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesSpecialParts()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesSpecialParts(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetSpecialPartPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesUnfoldedBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("UnfoldedBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Unfolded Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.UnFoldedBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesUnfoldedBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesUnfoldedBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesUnfoldedBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetUnfoldedStraightBeamProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/WeldConnectionTypeDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 |
9 | namespace AdvanceSteel.Nodes
10 | {
11 | [NodeName("WeldConnectionTypes")]
12 | [NodeDescription("Lists the Advance Steel Weld connection type options")]
13 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
14 | [OutPortNames("weldType")]
15 | [OutPortTypes("int")]
16 | [OutPortDescriptions("weld connection type")]
17 | [IsDesignScriptCompatible]
18 | public class WeldConnectionType : AstDropDownBase
19 | {
20 | private const string outputName = "weldType";
21 |
22 | public WeldConnectionType()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public WeldConnectionType(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List()
41 | {
42 | new DynamoDropDownItem("Select Weld Type...", -1L),
43 | new DynamoDropDownItem("OnSite", 0L),
44 | new DynamoDropDownItem("InShop", 2L)
45 | };
46 |
47 | Items.AddRange(newItems);
48 |
49 | SelectedIndex = 0;
50 | return SelectionState.Restore;
51 | }
52 |
53 | public override IEnumerable BuildOutputAst(List inputAstNodes)
54 | {
55 | if (Items.Count == 0 ||
56 | Items[SelectedIndex].Name == "Select Weld Type..." ||
57 | SelectedIndex < 0)
58 | {
59 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
60 | }
61 |
62 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
63 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
64 | return new List { assign };
65 |
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesWeldLine.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("WeldLineProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Weld Lines")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesWeldLine : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesWeldLine()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesWeldLine(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };
41 | foreach (var item in Utils.GetWeldLinePropertiesList())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesConcBentBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ConcreteBentBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Concrete Bent Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Concrete.ConcreteBentBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesConcBentBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesConcBentBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesConcBentBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetConcreteBentBeamProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesShearStuds.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ShearStudProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Shear Stud")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesShearStud : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesShearStud()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesShearStud(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };//
41 | foreach (var item in Utils.GetShearStudPropertyList())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesWeldPoint.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("WeldPointProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Weld Points")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesWeldPoint : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesWeldPoint()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesWeldPoint(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };
41 | foreach (var item in Utils.GetWeldPointPropertiesList())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesAnchorBolt.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("AnchorBoltProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Anchor Bolt")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesAnchorBolt : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesAnchorBolt()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesAnchorBolt(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };
41 | foreach (var item in Utils.GetAnchorBoltPropertyList())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASObjectTypes.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 | using System;
8 |
9 | namespace AdvanceSteel.Nodes
10 | {
11 | [NodeName("AdvanceSteelObjectTypes")]
12 | [NodeDescription("Lists all the Advance Steel object types")]
13 | [NodeCategory("AdvanceSteel.Nodes.Selection")]
14 | [OutPortNames("objectType")]
15 | [OutPortTypes("int")]
16 | [OutPortDescriptions("advance steel object type")]
17 | [IsDesignScriptCompatible]
18 | public class ASObjecTypes : AstDropDownBase
19 | {
20 | private const string outputName = "objectType";
21 |
22 | public ASObjecTypes()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASObjecTypes(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List();
41 | Dictionary filterItems = Utils.GetASObjectFilters();
42 | foreach (var item in filterItems)
43 | {
44 | newItems.Add(new DynamoDropDownItem(item.Value, (long)item.Key));
45 | }
46 |
47 | Items.AddRange(newItems);
48 |
49 | SelectedIndex = 0;
50 | return SelectionState.Restore;
51 | }
52 |
53 | public override IEnumerable BuildOutputAst(List inputAstNodes)
54 | {
55 | if (Items.Count == 0 ||
56 | Items[SelectedIndex].Name == "Select Object Type..." ||
57 | SelectedIndex < 0)
58 | {
59 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
60 | }
61 |
62 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
63 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
64 | return new List { assign };
65 |
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesBeamNotchSqFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BeamOrthoNotchFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Beam Ortho Notch Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.BeamCope")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBeamNotchSqFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesBeamNotchSqFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesBeamNotchSqFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetBeamNotchOrthoPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesPlateVertexFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PlateVertexFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Plate Vertex Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.PlateVertexCut")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesPlateVertexFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesPlateVertexFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesPlateVertexFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetPlateVertexPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesIsolatedFooting.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ConcreteIsolatedFootingProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Concrete Isolated Footing")]
12 | [NodeCategory("AdvanceSteel.Nodes.Concrete.Footings")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesIsolatedFooting : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesIsolatedFooting()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesIsolatedFooting(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetConcreteIsolatedFootingProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesBeamCutPlaneFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BeamCutPlaneFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Beam Cut Plane Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.BeamPlaneCut")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBeamCutPlaneFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesBeamCutPlaneFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesBeamCutPlaneFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetBeamCutPlanePropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesMidScrewBoltPattern.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("RectangularBoltProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Rectangular Bolt")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects.RectangularBoltPattern")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBolts : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public ASPropertiesBolts()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASPropertiesBolts(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };
41 | foreach (var item in Utils.GetMidScrewBoltPattern())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesBeamNotchExFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BeamRotatedNotchFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Beam Rotated Notch Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.BeamCope")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBeamNotchExFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesBeamNotchExFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesBeamNotchExFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetBeamNotchRotatedPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesConcStraightBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("ConcreteStraightBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Concrete Straight Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Concrete.ConcreteStraightBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesConcStraightBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesConcStraightBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesConcStraightBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetConcreteStraightBeamProperties())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/SteelElements/ASPropertiesCompoundStraightBeam.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("CompoundStraightBeamProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Compound Straight Beam")]
12 | [NodeCategory("AdvanceSteel.Nodes.Beams.CompoundBeam")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesCompoundStraightBeam : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesCompoundStraightBeam()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesCompoundStraightBeam(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetCompoundStraightBeamPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/ASPropertiesCircleScrewBoltPattern.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("CircularBoltProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Circular Bolt Pattern")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects.CircularBoltPattern")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class CircleScrewBoltPattern : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | //AdvanceSteel.Nodes.Properties
22 | public CircleScrewBoltPattern()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public CircleScrewBoltPattern(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List() { };
41 | foreach (var item in Utils.GetCircleScrewBoltPattern())
42 | {
43 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
44 | }
45 | Items.AddRange(newItems);
46 |
47 | SelectedIndex = 0;
48 | return SelectionState.Restore;
49 | }
50 |
51 | public override IEnumerable BuildOutputAst(List inputAstNodes)
52 | {
53 | if (Items.Count == 0 ||
54 | Items[SelectedIndex].Name == "None" ||
55 | SelectedIndex < 0)
56 | {
57 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
58 | }
59 |
60 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
61 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
62 |
63 | return new List { assign };
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/BoltConnectionTypeDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BoltConnectionTypes")]
11 | [NodeDescription("Lists the Advance Steel Bolt Connection type options")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("boltType")]
14 | [OutPortTypes("int")]
15 | [OutPortDescriptions("bolt connection type")]
16 | [IsDesignScriptCompatible]
17 | public class BoltConnectionType : AstDropDownBase
18 | {
19 | private const string outputName = "boltType";
20 |
21 | public BoltConnectionType()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public BoltConnectionType(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List()
40 | {
41 | new DynamoDropDownItem("Select Bolt Type...", -1L),
42 | new DynamoDropDownItem("OnSite", 0L),
43 | new DynamoDropDownItem("Site Drill", 1L),
44 | new DynamoDropDownItem("InShop", 2L)
45 | };
46 |
47 | Items.AddRange(newItems);
48 |
49 | SelectedIndex = 0;
50 | return SelectionState.Restore;
51 | }
52 |
53 | public override IEnumerable BuildOutputAst(List inputAstNodes)
54 | {
55 | if (Items.Count == 0 ||
56 | Items[SelectedIndex].Name == "Select Bolt Type..." ||
57 | SelectedIndex < 0)
58 | {
59 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
60 | }
61 |
62 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
63 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
64 | return new List { assign };
65 |
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesBeamPolylineNotchFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BeamMultiNotchFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Beam Multi Notch Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.BeamPolycut")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesBeamPolylineNotchFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesBeamPolylineNotchFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesBeamPolylineNotchFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetBeamMultiNotchPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/ASPropertiesPlatePolylineNotchFeatures.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PlateNotchContourFeatureProperties")]
11 | [NodeDescription("Lists all the property names of an Advance Steel Plate Notch Contour Feature")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.PlatePolycut")]
13 | [OutPortNames("propertyName")]
14 | [OutPortTypes("string")]
15 | [OutPortDescriptions("name of the selected property")]
16 | [IsDesignScriptCompatible]
17 | public class ASPropertiesPlatePolylineNotchFeatures : AstDropDownBase
18 | {
19 | private const string outputName = "propertyName";
20 |
21 | public ASPropertiesPlatePolylineNotchFeatures()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public ASPropertiesPlatePolylineNotchFeatures(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List() { };
40 | foreach (var item in Utils.GetPlateNotchContourPropertyList())
41 | {
42 | newItems.Add(new DynamoDropDownItem(item.Key, item.Value));
43 | }
44 | Items.AddRange(newItems);
45 |
46 | SelectedIndex = 0;
47 | return SelectionState.Restore;
48 | }
49 |
50 | public override IEnumerable BuildOutputAst(List inputAstNodes)
51 | {
52 | if (Items.Count == 0 ||
53 | Items[SelectedIndex].Name == "None" ||
54 | SelectedIndex < 0)
55 | {
56 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
57 | }
58 |
59 | var intNode = AstFactory.BuildPrimitiveNodeFromObject((string)Items[SelectedIndex].Name);
60 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
61 |
62 | return new List { assign };
63 |
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/HoleDirectionDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 |
9 | namespace AdvanceSteel.Nodes
10 | {
11 | [NodeName("HoleDirection")]
12 | [NodeDescription("Lists the Advance Steel Slotted Hole Direction options")]
13 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
14 | [OutPortNames("slotDirection")]
15 | [OutPortTypes("int")]
16 | [OutPortDescriptions("slotted hole direciton")]
17 | [IsDesignScriptCompatible]
18 | public class SlotDirection : AstDropDownBase
19 | {
20 | private const string outputName = "slotDirection";
21 |
22 | public SlotDirection()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public SlotDirection(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List()
41 | {
42 | new DynamoDropDownItem("Select Slotted Hole Direction...", -1L),
43 | new DynamoDropDownItem("Arc Along", 2L),
44 | new DynamoDropDownItem("X-Axis", 1L),
45 | new DynamoDropDownItem("Y-Axis", 2L)
46 | };
47 |
48 | Items.AddRange(newItems);
49 |
50 | SelectedIndex = 0;
51 | return SelectionState.Restore;
52 | }
53 |
54 | public override IEnumerable BuildOutputAst(List inputAstNodes)
55 | {
56 | if (Items.Count == 0 ||
57 | Items[SelectedIndex].Name == "Select Slotted Hole Direction..." ||
58 | SelectedIndex < 0)
59 | {
60 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
61 | }
62 |
63 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
64 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
65 | return new List { assign };
66 |
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Miscellaneous/BodyResolution.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("BodyResolutions")]
11 | [NodeDescription("Lists all options for body resolution")]
12 | [NodeCategory("AdvanceSteel.Nodes.Util.Geometry")]
13 | [OutPortNames("bodyResolution")]
14 | [OutPortTypes("int")]
15 | [OutPortDescriptions("body resolution")]
16 | [IsDesignScriptCompatible]
17 | public class BodyResolution : AstDropDownBase
18 | {
19 | private const string outputName = "bodyResolution";
20 |
21 | public BodyResolution()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public BodyResolution(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List()
40 | {
41 | new DynamoDropDownItem("Select Body Resolution...", -1L),
42 | new DynamoDropDownItem("Normal", 0L),
43 | new DynamoDropDownItem("Detailed", 1L),
44 | new DynamoDropDownItem("Hull", 2L),
45 | new DynamoDropDownItem("UnNotched", 3L)
46 | };
47 |
48 | Items.AddRange(newItems);
49 |
50 | SelectedIndex = 0;
51 | return SelectionState.Restore;
52 | }
53 |
54 | public override IEnumerable BuildOutputAst(List inputAstNodes)
55 | {
56 | if (Items.Count == 0 ||
57 | Items[SelectedIndex].Name == "Select Body Resolution..." ||
58 | SelectedIndex < 0)
59 | {
60 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
61 | }
62 |
63 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
64 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
65 | return new List { assign };
66 |
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/PlateFilletVertexTypeDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("PlateFilletVertexTypes")]
11 | [NodeDescription("Lists the Advance Steel Plate Fillet Vertex type options")]
12 | [NodeCategory("AdvanceSteel.Nodes.Features.PlateVertexCut")]
13 | [OutPortNames("vertexType")]
14 | [OutPortTypes("int")]
15 | [OutPortDescriptions("type of vertex")]
16 | [IsDesignScriptCompatible]
17 | public class PlateFilletVertexType : AstDropDownBase
18 | {
19 | private const string outputName = "vertexType";
20 |
21 | public PlateFilletVertexType()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public PlateFilletVertexType(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List()
40 | {
41 | new DynamoDropDownItem("Select Plate Corener Cut Type...", -1L),
42 | new DynamoDropDownItem("Convex", 0L),
43 | new DynamoDropDownItem("Concave", 1L),
44 | new DynamoDropDownItem("Striaght", 2L)
45 | };
46 |
47 | Items.AddRange(newItems);
48 |
49 | SelectedIndex = 0;
50 | return SelectionState.Restore;
51 | }
52 |
53 | public override IEnumerable BuildOutputAst(List inputAstNodes)
54 | {
55 | if (Items.Count == 0 ||
56 | Items[SelectedIndex].Name == "Select Plate Corener Cut Type..." ||
57 | SelectedIndex < 0)
58 | {
59 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
60 | }
61 |
62 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
63 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
64 | return new List { assign };
65 |
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/AdvanceSteelNodes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {785BB90B-886C-411D-8D34-8F85E9479A9C}
7 | AdvanceSteel.Nodes
8 | false
9 | $(OutputPath)\AdvanceSteelNodes.xml
10 | MSB3277;CS1591
11 |
12 |
13 |
14 | $(ADVANCESTEELAPI)\ASCADLinkMgd.dll
15 | False
16 |
17 |
18 | $(ADVANCESTEELAPI)\ASGeometryMgd.dll
19 | False
20 |
21 |
22 | $(ADVANCESTEELAPI)\ASModelerMgd.dll
23 | False
24 |
25 |
26 | $(ADVANCESTEELAPI)\ASProfilesMgd.dll
27 | False
28 |
29 |
30 | $(ADVANCESTEELAPI)\ASObjectsMgd.dll
31 | False
32 |
33 |
34 | $(ADVANCESTEELAPI)\Extensions\DotNetRoots.dll
35 | False
36 |
37 |
38 | $(DYNAMOAPI)\DSCoreNodes.dll
39 | False
40 |
41 |
42 | $(DYNAMOAPI)\DynamoServices.dll
43 | False
44 |
45 |
46 | $(DYNAMOAPI)\ProtoGeometry.dll
47 | False
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/base/SteelDbObject.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.DesignScript.Interfaces;
2 | using Autodesk.DesignScript.Runtime;
3 | using System;
4 | using Dynamo.Applications.AdvanceSteel.Services;
5 |
6 | namespace AdvanceSteel.Nodes
7 | {
8 | ///
9 | /// This is the equivalent of an Advance Steel object in Dynamo
10 | ///
11 | [IsVisibleInDynamoLibrary(false)]
12 | public abstract class SteelDbObject : SteelDynObject, IGraphicItem
13 | {
14 | protected string ObjectHandle;
15 | protected static readonly object access_obj = new object();
16 | internal bool IsOwnedByDynamo = true;
17 |
18 | ///
19 | /// Property that holds the handle of the object
20 | ///
21 | [IsVisibleInDynamoLibrary(false)]
22 | public string Handle
23 | {
24 | get
25 | {
26 | return ObjectHandle;
27 | }
28 | set
29 | {
30 | ObjectHandle = value;
31 |
32 | var elementManager = LifecycleManager.GetInstance();
33 | elementManager.RegisterAsssociation(ObjectHandle, this);
34 | }
35 | }
36 |
37 | [IsVisibleInDynamoLibrary(false)]
38 | public override void Dispose()
39 | {
40 | lock (access_obj)
41 | {
42 | // Do not cleanup elements if we are shutting down Dynamo.
43 | if (DisposeLogic.IsShuttingDown || DisposeLogic.IsClosingHomeworkspace)
44 | return;
45 |
46 | var elementManager = LifecycleManager.GetInstance();
47 |
48 | int remainingBindings = elementManager.UnRegisterAssociation(Handle, this);
49 |
50 | // Do not delete owned elements
51 | if (remainingBindings == 0 && IsOwnedByDynamo == true)
52 | {
53 | if (Handle != null)
54 | {
55 | //lock the document and start a transaction
56 | using (var ctx = new DocContext())
57 | {
58 | var filerObject = Utils.GetObject(Handle);
59 |
60 | if (filerObject != null)
61 | filerObject.DelFromDb();
62 |
63 | ObjectHandle = string.Empty;
64 | }
65 | }
66 | }
67 | else
68 | {
69 | //This element has gone
70 | ObjectHandle = string.Empty;
71 | }
72 | }
73 | }
74 |
75 | [IsVisibleInDynamoLibrary(false)]
76 | public void Tessellate(IRenderPackage package, TessellationParameters parameters)
77 | {
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/DynamoSteelApp.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.Runtime;
2 | using Autodesk.AdvanceSteel;
3 | using System;
4 | using System.IO;
5 | using System.Reflection;
6 | using Autodesk.AdvanceSteel.ASSettings;
7 | using System.Runtime.Versioning;
8 |
9 | [assembly: ExtensionApplicationAttribute(typeof(Dynamo.Applications.AdvanceSteel.DynamoSteelApp))]
10 |
11 | namespace Dynamo.Applications.AdvanceSteel
12 | {
13 | public sealed class DynamoSteelApp : IExtensionApplication
14 | {
15 | public static string DynamoCorePath = ProductLocator.GetDynamoCorePath();
16 | #pragma warning disable CA1416 // Validate platform compatibility
17 | public static string ASCInstallPath = ProductLocator.GetASCInstallPath();
18 | #pragma warning restore CA1416 // Validate platform compatibility
19 | public static Action ShutdownHandler = null;
20 |
21 | void IExtensionApplication.Initialize()
22 | {
23 | SubscribeAssemblyResolvingEvent();
24 | }
25 |
26 | void IExtensionApplication.Terminate()
27 | {
28 | ShutdownHandler?.Invoke();
29 | UnsubscribeAssemblyResolvingEvent();
30 | }
31 |
32 | private void SubscribeAssemblyResolvingEvent()
33 | {
34 | AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
35 | }
36 |
37 | private void UnsubscribeAssemblyResolvingEvent()
38 | {
39 | AppDomain.CurrentDomain.AssemblyResolve -= ResolveAssembly;
40 | }
41 |
42 | public static Assembly ResolveAssembly(object sender, ResolveEventArgs args)
43 | {
44 | var assemblyPath = string.Empty;
45 | var assemblyName = new AssemblyName(args.Name).Name + ".dll";
46 |
47 | try
48 | {
49 | var corePath = DynamoCorePath;
50 |
51 | assemblyPath = Path.Combine(corePath, assemblyName);
52 |
53 | return (File.Exists(assemblyPath) ? Assembly.LoadFrom(assemblyPath) : null);
54 | }
55 | catch (Exception ex)
56 | {
57 | throw new Exception(string.Format("The location of the assembly, {0} could not be resolved for loading.", assemblyPath), ex);
58 | }
59 | }
60 | }
61 |
62 | internal class ProductLocator
63 | {
64 | public static string GetDynamoCorePath()
65 | {
66 | string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
67 | return Path.Combine(currentDir, "Core");
68 | }
69 |
70 | [SupportedOSPlatform("windows")]
71 | public static string GetASCInstallPath()
72 | {
73 | return ASSettingsUtils.GetASCInstallPath();
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Features/HoleTypeDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 |
9 | namespace AdvanceSteel.Nodes
10 | {
11 | [NodeName("HoleTypes")]
12 | [NodeDescription("Lists the Advance Steel Hole type options")]
13 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
14 | [OutPortNames("holeType")]
15 | [OutPortTypes("int")]
16 | [OutPortDescriptions("hole type")]
17 | [IsDesignScriptCompatible]
18 | public class HoleType : AstDropDownBase
19 | {
20 | private const string outputName = "holeType";
21 |
22 | public HoleType()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public HoleType(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List()
41 | {
42 | new DynamoDropDownItem("Select Hole Type...", -1L),
43 | new DynamoDropDownItem("Hole", 1L),
44 | new DynamoDropDownItem("Slotted Hole", 2L),
45 | new DynamoDropDownItem("Counter Sunk Hole", 3L),
46 | new DynamoDropDownItem("Blind Hole", 4L),
47 | new DynamoDropDownItem("Threaded Hole", 5L),
48 | new DynamoDropDownItem("Sunk Hole", 6L),
49 | new DynamoDropDownItem("Punch Mark", 7L)
50 | };
51 |
52 | Items.AddRange(newItems);
53 |
54 | SelectedIndex = 0;
55 | return SelectionState.Restore;
56 | }
57 |
58 | public override IEnumerable BuildOutputAst(List inputAstNodes)
59 | {
60 | if (Items.Count == 0 ||
61 | Items[SelectedIndex].Name == "Select Hole Type..." ||
62 | SelectedIndex < 0)
63 | {
64 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
65 | }
66 |
67 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
68 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
69 | return new List { assign };
70 |
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/Miscellaneous/ASSelectObjectTypes.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 | using System;
8 |
9 | namespace AdvanceSteel.Nodes
10 | {
11 | [NodeName("GetSteelObjectsByType")]
12 | [NodeDescription("Select all steel objects by type")]
13 | [NodeCategory("AdvanceSteel.Nodes.Selection")]
14 | [OutPortDescriptions("list with the selected steel objects")]
15 | [OutPortNames("steelObjects")]
16 | [OutPortTypes("AdvanceSteel.Nodes.SteelDbObject")]
17 | [IsDesignScriptCompatible]
18 | public class ASSelectObjecTypes : AstDropDownBase
19 | {
20 | private const string outputName = "steelObjects";
21 |
22 | public ASSelectObjecTypes()
23 | : base(outputName)
24 | {
25 | InPorts.Clear();
26 | OutPorts.Clear();
27 | RegisterAllPorts();
28 | }
29 |
30 | [JsonConstructor]
31 | public ASSelectObjecTypes(IEnumerable inPorts, IEnumerable outPorts)
32 | : base(outputName, inPorts, outPorts)
33 | {
34 | }
35 |
36 | protected override SelectionState PopulateItemsCore(string currentSelection)
37 | {
38 | Items.Clear();
39 |
40 | var newItems = new List();
41 | Dictionary filterItems = Utils.GetASObjectFilters();
42 | foreach (var item in filterItems)
43 | {
44 | newItems.Add(new DynamoDropDownItem(item.Value, (long)item.Key));
45 | }
46 |
47 | Items.AddRange(newItems);
48 |
49 | SelectedIndex = 0;
50 | return SelectionState.Restore;
51 | }
52 |
53 | public override IEnumerable BuildOutputAst(List inputAstNodes)
54 | {
55 | if (Items.Count == 0 ||
56 | Items[SelectedIndex].Name == "Select Object Type..." ||
57 | SelectedIndex < 0)
58 | {
59 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
60 | }
61 | AssociativeNode node;
62 | IntNode intNode2 = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
63 | node = AstFactory.BuildFunctionCall(new Func>(Utils.GetDynObjects), new List() { intNode2 });
64 |
65 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), node);
66 | return new List { assign };
67 |
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/Util/BeamSection.cs:
--------------------------------------------------------------------------------
1 | using Autodesk.AdvanceSteel.CADAccess;
2 | using Autodesk.AdvanceSteel.Modelling;
3 | using System;
4 | using SteelServices = Dynamo.Applications.AdvanceSteel.Services;
5 |
6 | namespace AdvanceSteel.Nodes.Util
7 | {
8 | ///
9 | /// This node can be used to assign Section to Advance Steel beams from Dynamo
10 | ///
11 | public class BeamSection
12 | {
13 | internal BeamSection()
14 | {
15 | }
16 |
17 | ///
18 | /// This node can set the Section for Advance Steel beams from Dynamo.
19 | /// For the Section use the following format: "HEA DIN18800-1#@§@#HEA100"
20 | ///
21 | /// Advance Steel beam
22 | /// Section
23 | ///
24 | [Obsolete]
25 | public static void SetSection(AdvanceSteel.Nodes.SteelDbObject beamElement, string sectionName)
26 | {
27 | using (var ctx = new SteelServices.DocContext())
28 | {
29 | string handle = beamElement.Handle;
30 |
31 | FilerObject obj = Utils.GetObject(handle);
32 |
33 | if (obj != null && obj.IsKindOf(FilerObject.eObjectType.kBeam))
34 | {
35 |
36 | string sectionType = Utils.SplitSectionName(sectionName)[0];
37 | string sectionSize = Utils.SplitSectionName(sectionName)[1];
38 |
39 | Autodesk.AdvanceSteel.Modelling.Beam beam = obj as Autodesk.AdvanceSteel.Modelling.Beam;
40 | if (obj.IsKindOf(FilerObject.eObjectType.kCompoundBeam) && !Utils.CompareCompoundSectionTypes(beam.ProfSectionType, sectionType))
41 | {
42 | throw new System.Exception("Failed to change section as compound section type is different");
43 | }
44 | beam.ChangeProfile(sectionType, sectionSize);
45 | }
46 | else
47 | throw new System.Exception("Failed to change section");
48 | }
49 | }
50 |
51 | ///
52 | /// Returns a concatenated string containing the SectionType, a fixed string separator "#@§@#" and the SectionSize.
53 | ///
54 | /// SectionType for a beam section
55 | /// SectionSize for a beam section
56 | /// Beam section name
57 | [Obsolete]
58 | public static string CreateSectionString(string sectionType, string sectionSize)
59 | {
60 | return sectionType + Utils.Separator + sectionSize;
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/src/ContentBuilder/DocClasses.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml.Serialization;
7 |
8 | namespace ContentBuilder
9 | {
10 | [Serializable, XmlRoot("doc")]
11 | public class Doc
12 | {
13 | public Doc()
14 | {
15 | assembly = new AssemblyFile();
16 | content = new Members();
17 | }
18 |
19 | [XmlElement("assembly")]
20 | public AssemblyFile assembly { get; set; }
21 |
22 | [XmlElement("members")]
23 | public Members content { get; set; }
24 |
25 | public void AddContent(Doc other)
26 | {
27 | content.members.AddRange(other.content.members);
28 | }
29 | }
30 |
31 | public class AssemblyFile
32 | {
33 | [XmlElement("name")]
34 | public string name { get; set; }
35 | }
36 |
37 | public class Members
38 | {
39 | public Members()
40 | {
41 | members = new List();
42 | }
43 |
44 | [XmlElement("member")]
45 | public List members { get; set; }
46 | }
47 |
48 |
49 | public class Member
50 | {
51 | public Member()
52 | {
53 | name = String.Empty;
54 | remarks = String.Empty;
55 | }
56 |
57 | internal string signature { get; set; }
58 |
59 | [XmlAttribute]
60 | public string name { get; set; }
61 |
62 | [XmlElement("summary")]
63 | public Summary summary { get; set; }
64 |
65 | [XmlElement("param")]
66 | public List parameters { get; set; }
67 |
68 | [XmlElement("returns")]
69 | public List returns { get; set; }
70 |
71 | [XmlElement("remarks")]
72 | public string remarks { get; set; }
73 | }
74 |
75 |
76 | public class Summary
77 | {
78 | public Summary()
79 | {
80 | description = string.Empty;
81 | }
82 |
83 | [XmlText]
84 | public string description { get; set; }
85 | }
86 |
87 | public class Param
88 | {
89 | public Param()
90 | {
91 | name = String.Empty;
92 | description = string.Empty;
93 | }
94 |
95 | [XmlAttribute]
96 | public string name { get; set; }
97 |
98 | [XmlText]
99 | public string description { get; set; }
100 | }
101 |
102 | public class Return
103 | {
104 | public Return()
105 | {
106 | name = String.Empty;
107 | description = string.Empty;
108 | }
109 | [XmlAttribute]
110 | public string name { get; set; }
111 |
112 | [XmlText]
113 | public string description { get; set; }
114 | }
115 | }
--------------------------------------------------------------------------------
/src/DynamoAdvanceSteel/OneTransactionPerAllContexts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Dynamo.Applications.AdvanceSteel.Services;
7 | using Autodesk.AdvanceSteel.DocumentManagement;
8 |
9 | namespace Dynamo.Applications.AdvanceSteel
10 | {
11 | public class OneTransactionPerAllContexts : IContextManager
12 | {
13 | private static Autodesk.AdvanceSteel.CADAccess.Transaction SteelTransaction = null;
14 | private static bool DocumentLocked = false;
15 | private static bool SubscribedToRefreshCompleted = false;
16 |
17 | public void EnsureInContext(DocContext ctx)
18 | {
19 | StartTransaction();
20 | SubscribeToRefreshCompleted();
21 | }
22 |
23 | public void LeaveContext(DocContext ctx)
24 | {
25 |
26 | }
27 | private static void StartTransaction()
28 | {
29 | if (DocumentLocked == false)
30 | {
31 | DocumentLocked = DocumentManager.LockCurrentDocument();
32 | }
33 |
34 | if (SteelTransaction == null && DocumentLocked == true)
35 | {
36 | SteelTransaction = Autodesk.AdvanceSteel.CADAccess.TransactionManager.StartTransaction();
37 | }
38 |
39 | if (DocumentLocked == false || SteelTransaction == null)
40 | {
41 | throw new System.Exception("Failed to access Document");
42 | }
43 | }
44 | private static void CloseTransaction()
45 | {
46 | if (SteelTransaction != null)
47 | {
48 | SteelTransaction.Commit();
49 | SteelTransaction = null;
50 | }
51 |
52 | if (DocumentLocked == true)
53 | {
54 | DocumentLocked = DocumentManager.UnlockCurrentDocument();
55 | DocumentLocked = false;
56 | }
57 | }
58 | private static void RefreshCompleted(Graph.Workspaces.HomeWorkspaceModel obj)
59 | {
60 | CloseTransaction();
61 | UnsubscribeFromRefreshCompleted();
62 | }
63 | private static void SubscribeToRefreshCompleted()
64 | {
65 | if (SubscribedToRefreshCompleted == false)
66 | {
67 | var dynModel = Dynamo.Applications.AdvanceSteel.Model.DynamoModel;
68 | dynModel.RefreshCompleted += RefreshCompleted;
69 | SubscribedToRefreshCompleted = true;
70 | }
71 | }
72 | private static void UnsubscribeFromRefreshCompleted()
73 | {
74 | if (SubscribedToRefreshCompleted == true)
75 | {
76 | var dynModel = Dynamo.Applications.AdvanceSteel.Model.DynamoModel;
77 | dynModel.RefreshCompleted -= RefreshCompleted;
78 | SubscribedToRefreshCompleted = false;
79 | }
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodesUI/ConnectionObjects/AnchorOrientationTypeDropDown.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using CoreNodeModels;
3 | using Dynamo.Graph.Nodes;
4 | using Dynamo.Utilities;
5 | using ProtoCore.AST.AssociativeAST;
6 | using Newtonsoft.Json;
7 |
8 | namespace AdvanceSteel.Nodes
9 | {
10 | [NodeName("AnchorOrientationTypes")]
11 | [NodeDescription("Lists the Advance Steel Anchor orientation type options")]
12 | [NodeCategory("AdvanceSteel.Nodes.ConnectionObjects")]
13 | [OutPortNames("orientationType")]
14 | [OutPortTypes("int")]
15 | [OutPortDescriptions("anchor orientation type")]
16 | [IsDesignScriptCompatible]
17 | public class AnchorOrientationType : AstDropDownBase
18 | {
19 | private const string outputName = "orientationType";
20 |
21 | public AnchorOrientationType()
22 | : base(outputName)
23 | {
24 | InPorts.Clear();
25 | OutPorts.Clear();
26 | RegisterAllPorts();
27 | }
28 |
29 | [JsonConstructor]
30 | public AnchorOrientationType(IEnumerable inPorts, IEnumerable outPorts)
31 | : base(outputName, inPorts, outPorts)
32 | {
33 | }
34 |
35 | protected override SelectionState PopulateItemsCore(string currentSelection)
36 | {
37 | Items.Clear();
38 |
39 | var newItems = new List()
40 | {
41 | new DynamoDropDownItem("Select Anchor Orientation...", -1L),
42 | new DynamoDropDownItem("Normal Orientation", 0L),
43 | new DynamoDropDownItem("Diagonal Inside", 1L),
44 | new DynamoDropDownItem("Diagonal Outside", 2L),
45 | new DynamoDropDownItem("All Outside", 3L),
46 | new DynamoDropDownItem("All Inside", 4L),
47 | new DynamoDropDownItem("Inside Rotated", 5L),
48 | new DynamoDropDownItem("Outside Rotated", 6L)
49 | };
50 |
51 | Items.AddRange(newItems);
52 |
53 | SelectedIndex = 0;
54 | return SelectionState.Restore;
55 | }
56 |
57 | public override IEnumerable BuildOutputAst(List inputAstNodes)
58 | {
59 | if (Items.Count == 0 ||
60 | Items[SelectedIndex].Name == "Select Anchor Orientation..." ||
61 | SelectedIndex < 0)
62 | {
63 | return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };
64 | }
65 |
66 | var intNode = AstFactory.BuildIntNode((long)Items[SelectedIndex].Item);
67 | var assign = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), intNode);
68 | return new List { assign };
69 |
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/AdvanceSteelNodes/Util/SelectionFilter.cs:
--------------------------------------------------------------------------------
1 | using AdvanceSteel.Nodes.Plates;
2 | using Autodesk.AdvanceSteel.CADAccess;
3 | using Autodesk.DesignScript.Runtime;
4 | using DynGeometry = Autodesk.DesignScript.Geometry;
5 | using SteelGeometry = Autodesk.AdvanceSteel.Geometry;
6 | using Autodesk.AdvanceSteel.DotNetRoots.DatabaseAccess;
7 | using SteelServices = Dynamo.Applications.AdvanceSteel.Services;
8 | using Autodesk.AdvanceSteel.ConstructionTypes;
9 | using System.Collections.Generic;
10 | using Autodesk.AdvanceSteel.Geometry;
11 | using System.Linq;
12 | using System;
13 |
14 |
15 | namespace AdvanceSteel.Nodes.Selection
16 | {
17 | ///
18 | /// Select Advance Steel Objects
19 | ///
20 | public static class SelectionFilter
21 | {
22 |
23 | ///
24 | /// Filter a collection of steel objects by a list of object types
25 | ///
26 | /// List of steel objects
27 | /// List of accepted Steel Object Types
28 | /// gets a filtered list of steel objects that match the list of steel object types
29 | public static List FilterSelectionByType(List steelObjects,
30 | List objectTypeFilters)
31 | {
32 | List retListOfFilteredSteelObjects = new List