Professional Documents
Culture Documents
Once beams and plates are in place, connect them with bolts, anchors or welds.
This walkthrough will familiarize you with the basic concepts of connecting model elements in an Advance
Steel model with bolts, anchors and welds using the API. Refer back to the Hello World walkthrough to
create an empty Advance Steel addon project, up to the point of creating the command class. This tutorial
assumes you have a new Advance Steel addon project with one class file that implements the
IExtensionApplication interface.
Create a new class called CreateConnectors and add the following code:
using Autodesk.AdvanceSteel.CADAccess;
using Autodesk.AdvanceSteel.DocumentManagement;
using Autodesk.AdvanceSteel.Runtime;
using Autodesk.AdvanceSteel.Geometry;
using Autodesk.AdvanceSteel.Modelling;
using Autodesk.AdvanceSteel.Profiles;
using System.Collections.Generic;
namespace HelloWorld
CommandFlags.Modal |
CommandFlags.UsePickSet | CommandFlags.Redraw)]
da.Commit();
Before we can add connections, we need something to connect. Let's start with two short columns. Add a
method called CreateStackedColumns() to the CreateConnectors class to add 2 stacked columns like this:
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 1/6
11/10/21, 4:30 PM Help | Walkthrough: Creating Model Connectors and Relations | Autodesk
bottomColumn.WriteToDb();
topColumn.WriteToDb();
FinitRectScrewBoltPattern
InfinitRectScrewBoltPattern
InfinitMidScrewBoltPattern
CircleScrewBoltPattern
For this tutorial, we will create a bolt pattern in a rectangular area, defined by diagonally opposite corner
points, with 8 bolts. Add a new method to the CreateConnectors class called ConnectColumnsWithBolts as
shown below.
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 2/6
11/10/21, 4:30 PM Help | Walkthrough: Creating Model Connectors and Relations | Autodesk
myPlate.WriteToDb();
new
Point3d(plateOrig.x + 25, plateOrig.y, plateOrig.z + 75),
new
Vector3d(1, 0, 0), new Vector3d(0, 0, 1));
boltPattern.WriteToDb();
boltPattern.Nx = 2;
boltPattern.Connect(objectsToConnect, AtomicElement.eAssemblyLocation.kOnSite);
The code above first creates a plate between the given columns. Then the rectangular bolt pattern is
defined based on the plate's location. The number of bolts defined for the local x and y axis can be set after
the pattern is created. In this case, it will create a 2x4 pattern of bolts.
The last step is to connect the objects together with the bolt pattern. A HashSet< FilerObject> collection is
filled with the objects to be connected and then used by the Connect() method. In this case, the plate and
two columns are added to the collection.
Note that the Connect() method takes a parameter indicating the assembly location (on site in the code
above). The AtomicElement class used for this parameter is in the
Autodesk.AdvanceSteel.ConstructionTypes. Add the following using statement to the top of the class file:
using Autodesk.AdvanceSteel.ConstructionTypes;
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 3/6
11/10/21, 4:30 PM Help | Walkthrough: Creating Model Connectors and Relations | Autodesk
{
//create a baseplate
plate.WriteToDb();
anchorPattern.WriteToDb();
anchorPattern.Grade = "4.6";
anchorPattern.BoltAssembly = "2M";//"2N";
anchorPattern.ScrewDiameter = 16;
anchorPattern.Nx = 1;
anchorPattern.Ny = 2;
anchorPattern.Connect(objectsToConnect, AtomicElement.eAssemblyLocation.kOnSite);
As seen in the code above, the AnchorPattern is defined the same as the FinitRectScrewBoltPattern was -
by diagonally opposite corner points. Rather than using the default anchor type, this code will change the
bolts used for the anchor to "French cane anchor". The AnchorPattern properties need to be set to a valid
combination of properties. Valid sets of properties can be determined from the Anchors tool in the
Advance Steel Management Tools (a separate application installed with Advance Steel).
// create a weld
WeldPoint weld = new WeldPoint(new Point3d(145, 0, 0), new Vector3d(1, 0, 0), new
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 4/6
11/10/21, 4:30 PM Help | Walkthrough: Creating Model Connectors and Relations | Autodesk
Vector3d(0, 1, 0));
weld.WriteToDb();
weld.Connect(objectsToConnect, AtomicElement.eAssemblyLocation.kInShop);
weld.WriteToDb();
weld.Connect(objectsToConnect, AtomicElement.eAssemblyLocation.kInShop);
The code above will add two weld points connecting the bottom of the column to the provided plate.
ConnectColumnsWithBolts(bottomColumn, topColumn);
Plate basePlate;
CreateBaseplateWithAnchors(bottomColumn, out
basePlate);
WeldColumnToPlate(bottomColumn, basePlate);
da.Commit();
Prior to running this command in Advance Steel, you will need to add the necessary Informational
Attribute directives in the AssemblyInfo.cs file as shown in the Hello World Walkthrough.
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 5/6
11/10/21, 4:30 PM Help | Walkthrough: Creating Model Connectors and Relations | Autodesk
After running the CreateConnectors command in Advance Steel and zooming in, you should see something
like this:
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-
NonCommercial-ShareAlike 3.0 Unported License. Please see the Autodesk Creative Commons FAQ
for more information.
© 2021 Autodesk Inc. All rights reserved
https://help.autodesk.com/view/ADSTPR/2021/ENU/?guid=GUID-0BC13443-7B8B-4393-A1D8-2F79476BB165 6/6