Advance Steel COM API Developer Training Guide
Advance Steel COM API Developer Training Guide
Contents
3
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
4
1 Chapter 1
Advance Steel Development possibilities
1.1 Introduction to the Advance Steel API
The Advance Steel API allows you to program with any .NET compliant language including Visual
Basic.NET, C#, and C++. Before using the API, learn to use Advance Steel and its features so that
you can better understand this API.
Create joints
Create commands
1.3 Requirements
1.4 Installation
The Advance Steel API is installed with Advance Steel. Microsoft Visual Studio 2015 Express can be
downloaded from http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
2 Chapter 2
Advance Steel Modeling
2.1 What are joints?
Joints are complex elements that consist of basic elements and dependent elements that are
controlled by a construction rule.
All individual elements in the joint, including their properties and processing objects, are held together
and represented as a gray box (connection object).
All connection objects and definitions are included in the gray box.
Joint workflow:
The IRule interface Query method is called when a joint should be created. In this method you can
select the input objects for your joint and to initialize default parameters.
The IRule interface CreateObjects contains the joint functionality. It uses the global variables declared
in the declaration section and do the main work. The IRule interface GetUserPages is called when the
“Advance Steel Joint Properties" command is invoked.
The IJointInfo interface properties are interrogated to get information about the developer. You need to
add a record in AstorRules.HRLDefinition and AstorRules.RulesDllSigned tables after developing
a joint to be able to execute it in Advance Steel.
The joint can be executed with a command like
"AstM4CrConByVB RuleName" or "AstM4CommStructAsJointVB box RuleName"
Advance Steel creates and modifies joints by using rules. The IRule interface defines several
methods/properties, each being responsible for a certain task.
The Joint provides the link of IRule with the underlying Joint object of Advance Steel. The Joint object
is set by Advance Steel before calling any method of the Rule.
The Query method describes the input parameters of the joint. Its implementation should ask for the
user for input with the help of IAstUI and add the necessary entities to InputObjects of the joint.
Note: If the joint is called with "AstM4CommStructAsJointVB box RuleName" the InputObjects
array contains an element (the structural box) of type IStructuralBox in the beginning of the
Query Method. You can take the box parameter from the InputObjects array and use it or
modify it.
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
The CreateObjects method should create Advance Steel objects and add them to the CreatedObjects of
the joint. Rules can be written by anybody. The Advance Steel framework is able to execute them at
runtime. Thus, several services are provided - creation, list, modification, explode, deletion of a joint object:
A joint object is created along with its driven objects. A dialog box appears displaying all the
parameters which apply to that joint category.
AutoCAD’s list command lists the joint type (and parameters in later versions).
Editing a joint object leads to the appropriate dialog box.
Exploding an object means deleting the “logical joint unit” while maintaining the driven objects.
These objects will live explicitly then and will not know anything about the joint anymore.
Deleting an object means deleting the logical unit and the driven objects as well. This includes
features at driving objects, e.g. beam notches etc.
A command is created through an object which implements the IExternalMethod interface defined by
AstSTEELAUTOMATIONLib library. The difference between joint is that, the command is a “once-
only” logic type, being unable to update already created objects. The Run method must be
implemented.
The command can be executed “AstM9CommExecuteExternalCode commandName”
9
3 Chapter 3
Advance Steel Modeling API Presentation
3.1 Geometry API
These are the basic geometric objects. In any joint that will be developed you will have to use at least
a few of these objects (IPoint3d, IVector3d, IPlane, etc.).
3.1.1 IPoint3d
3.1.1.1 Properties
X (property) - Gets or sets the x coordinate of the point.
Y (property) - Gets or sets the y coordinate of the point.
Z (property) - Gets or sets the z coordinate of the point.
3.1.1.2 Methods
Add(IVector3d VectorToAdd) - Adds the specified vector to this point.
Create(double dfX, double dfY, double dfZ) - Creates the point with specified coordinates.
DistanceTo(IPoint3d target) - Returns the distance between points.
Project(IPlane targetPlane, IVector3d projDir) - Projects the point on the specified plane, along
the direction given by the vector.
Subtract(IPoint3d Subtracter) - Returns a vector, oriented from subtracter to this point:
p1.Subtract(p2) – the vector is oriented from p2 to p1
TransformBy(IMatrix3d TransformMatrix) - Applies the transformation specified by the matrix to
this point.
3.1.1.3 Example: Create 2 points, calculate the distance between them and create a vector
from the second point to the first.
private void Points()
{
//create a point with specified coordinates
IPoint3d point = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
point.Create(10, 10, 0);
//move point along Z axis with 100 mm
IVector3d vector = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
vector.Create(0, 0, 1);
vector.Multiply(100); //vector has a new length (and new orientation if the value is negative)
point.Add(vector);
//print point coordinates
Debug.WriteLine("x: " + point.x.ToString() + "y: " + point.y.ToString() + "z: " + point.z.ToString());
Output: x: 10 y: 10 z:100
IPoint3d p1 = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
IPoint3d p2 = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
p1.Create(0, 0, 0);
p2.Create(50, 0, 0);
double distance = p1.DistanceTo(p2);
//print distance between points
Debug.WriteLine("Distance between points is: " + distance.ToString());
Output: Distance between points is: 50.0
//return a vector oriented from p2 to p1
vector = p1.Subtract(p2);
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
3.1.2 IVector3d
3.1.2.1 Properties
X (property) - Gets or sets the x dimension of the vector.
Y (property) - Gets or sets the y dimension of the vector.
Z (property) - Gets or sets the z dimension of the vector.
3.1.2.2 Methods
Create(double dfX, double dfY, double dfZ) - Creates a vector with the specified coordinates.
CrossProduct(IVector3d pV) - Returns a vector - the result of the cross product of this vector and
specified vector. Useful when creating a CS (Coordinate system). See Figure 1.
DotProduct(IVector3d ProductWithVect) - Returns the result of the scalar product of this vector
and the specified vector.
GetAngle(IVector3d inVect) - Returns the angle between the vectors (in radians).
GetAngleWithReference(IVector3d inVect, IVector3d referenceVect) - Returns the angle between
the vectors using a reference vector.
IsPerpendicularTo(IVector3d inVect) - Returns true if this vector is perpendicular on the specified
vector, otherwise it returns false.
Multiply(double dfValue) - Multiplies the vector with the specified value – the vector has a new
length (and a new orientation if the value is negative).
Normalize() - Normalize the vector (length = 1). Does not change in any way the orientation.
RotateBy(IVector3d inVect, double AngleVal) - Rotates the vector around the specified vector
with the specified angle (in radians).
axb
b
a
bxa
Figure 1.
3.1.2.3 Example: Create 2 vectors, find the dot product, rotate the vectors and find the angles
between them, check if they are perpendicular, determine their lengths.
private void Vectors()
{
IVector3d xAxis = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
IVector3d yAxis = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
xAxis.Create(1, 0, 0);
yAxis.Create(0, 1, 0);
//cross product
IVector3d zAxis = xAxis.CrossProduct(yAxis);
//dot product is: 1 if angle = 0, > 0 if angle < 90, 0 if angle = 90, < 0 if angle > 90
double dotProd = xAxis.DotProduct(yAxis);
Debug.WriteLine("Scalar product is " + dotProd.ToString());
13
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//Returns the lower angle between vectors. Doesn't matter if we call function yAxis.GetAngle(xAxis),
function will return same result
double dAngle = xAxis.GetAngle(yAxis);
Debug.WriteLine("Angle from x to y is " + ((dAngle * 180) / Math.PI).ToString() + " degrees");
//If we want angle on other side from xAxis to yAxis we need to use GetAngleWithReference
function
zAxis.Multiply(-1); //Change zAxis direction
if(zAxis.IsPerpendicularTo(xAxis))
{
Debug.WriteLine("Vectors are perpendicular!");
}
zAxis.Multiply(57);
Debug.WriteLine("Vector length is " + zAxis.Length.ToString());
3.1.3 ILine3d
3.1.3.1 Properties/Methods
Origin - Returns the origin point of this line.
Direction - Returns the direction vector of this line.
CreateFromVectorAndPoint(IPoint3d inPoint, IVector3d inVect) - Creates a line with the specified
origin and direction.
14
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
xAxis.Create(1, 0, 0);
3.1.4 IPlane
3.1.4.1 Properties/Methods
PointOnPlane - Returns the origin of this plane.
Normal - Returns the plane’s normal vector.
CreateFromPointAndNormal(IPoint3d inPoint, IVector3d inVect) - Create a plane with the
specified origin and normal.
get_DistanceTo(IPoint3d ptIn) - Returns the distance from this plane to the input point
intersectWithLine(ILine3d inLine, out IPoint3d ptIntersection) - Calculates the intersection point
of this plane with a line. Returns True or False depending on whether the objects intersect.
3.1.4.2 Example: Create a plane and a line and find the intersection point where the line
meets the plane.
private void Planes()
{
IPoint3d origin = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
origin.Create(100, 100, 100);
15
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
3.1.5 ICS3d
There are two coordinate Systems: - fixed system called World Coordinate System (WCS), and a
movable system called User Coordinate System (UCS). When create a beam for example you need
to specify a coordinate system where beam will be created. Coordinate systems can make easier your
work when create joints.
A coordinate system is defined by three axes (vectors) and origin point. The axes define three
coordinate planes. The (XY) plane contains the x - axis and the y- axis. The (YZ) contains the y - axis
and z - axis. The (XZ) plane contains x - axis and z- axis. Origin point is at intersection of these planes.
3.1.5.1 Properties
Origin - Gets or sets the CS origin (as a Point3d).
XAxis - Gets or sets the CS X axis (as a Vector3d).
YAxis - Gets or sets the CS Y axis (as a Vector3d).
ZAxis - Gets or sets the CS Z axis (as a Vector3d).
3.1.5.2 Methods
RotateCSAroundX(double AngleVal) - Rotates the CS around X axis with the specified angle
value (in radians).
RotateCSAroundY(double AngleVal) - Rotates the CS around Y axis with the specified angle
value (in radians).
RotateCSAroundZ(double AngleVal) - Rotates the CS around Z axis with the specified angle
value (in radians).
TransformBy(IMatrix3d TransforMatrix) - Applies the transformation specified by the matrix to this
CS.
TranslateCS(IVector3d TranslationVect) - Translates the CS origin with the specified vector. The
vector is interpreted as being in this CS, not in WCS. For example: To translate this CS
along its own X-axis the vector (1, 0, 0) multiplied by the desired value should be passed to
this method.
SetToAlignCS(ICS3d pToCS) - Returns the Matrix3d that transforms objects from this coordinate
system to the “pToCS” coordinate system (the matrix can be used in an
object.TransformBy(matrix) method call).
16
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
3.1.6 IAugPolygon3d
//create polygon
IAugPolygon3d polygon = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon.AppendVertex(p1);
polygon.AppendVertex(p2);
polygon.AppendVertex(p3);
polygon.AppendVertex(p4);
}
Creating a plate using this polygon the output will be:
17
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
{
IVertexInfo vertexInfo = (IVertexInfo)(new DSCGEOMCOMLib.vertexInfo());
//create polygon
IAugPolygon3d polygon = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon.AppendNewVertex(p1, vertexInfo, true);
polygon.AppendVertex(p2);
polygon.AppendVertex(p3);
polygon.AppendVertex(p4);
polygon.AppendVertex(p5);
}
In this chapter you will learn how you can create objects using Advance Steel API. The Advance Steel
model is built from elements such as beams, plates, structural elements, bolts, welds, features, and
joints.
18
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
3.2.1 Beams
CreateStraightBeam(string sectClass, string sectName, Role pRole, IPoint3d pt0, IPoint3d pt1,
ICS3d InputCS) - Returns a straight beam object. The beam’s className and sectionName are
the internal names.
section.className = value from AstorProfiles.ProfileMasterTable, column TypeNameText
section.Name = from the definition table for className, value of column SectionName
startPoint.Create(0, 0, 0);
endPoint.Create(0, 0, 500);
//Get the default profile from the database (default profiles are set in the GAM)
private void getDefaultProfile(int defaultClass, string className, out string sectionClass, out string
sectionSize)
19
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
{
sectionClass = "";
sectionSize = "";
if (section.Length == 2)
{
sectionClass = section[0];
sectionSize = section[1];
}
}
//Create the JointTransfer for a beam
private void setJointTransferForBeam(ref IJointTransfer jointTrans, eClassType classType)
{
jointTrans.ClassType = classType;
/set here all the properties which can be modified outside the joint
jointTrans.set_Attribute(eAttributeCodes.kBeamDenotation, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMaterial, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamCoating, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamAssembly, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamItemNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamNote, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPUsedForNumbering, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPDisplayRestriction, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPExplicitQuantity, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMPUsedForNumbering, 1);
}
20
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
CreateBentBeam(string sectClass, string Name, Role pRole, IPoint3d pt0, IPoint3d pt1, IPoint3d
anyArcPoint, double rotAngle) - Returns a Bent Beam object. The beam’s className and
sectionName are the internal names for the section.
section.className = value from AstorProfiles.ProfileMasterTable, column TypeNameText
section.Name = from the definition table for className, value of column SectionName
startPoint.Create(0, 0, 0);
endPoint.Create(500, 0, 0);
pointOnArc.Create(250, 300, 0);
21
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
3.2.1.3 Example
p1.Create(0, 0, 0);
p2.Create(300, 0, 0);
p3.Create(300, 300, 0);
p4.Create(300, 600, 0);
p5.Create(300, 600, -100);
//radius
double radius = 150;
IVector3d zAxis = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
zAxis.Create(0, 0, 1);
//build polyline
22
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
23
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
xAxis.Create(1, 0, 0);
yAxis.Create(0, 1, 0);
zAxis.Create(0, 0, 1);
//build polyline
IAugPolyline3d polyline = (IAugPolyline3d)(new DSCGEOMCOMLib.AugPolyline3d());
//polyline CS
ICS3d polylineCS = (ICS3d)(new DSCGEOMCOMLib.CS3d());
polylineCS.XAxis = xAxis;
polylineCS.YAxis = yAxis;
polylineCS.ZAxis = zAxis;
polylineCS.Origin = startPoint;
24
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Try creating an unfolded beam with the polyline used in creating a polybeam (Example 3.2.1.3).
//input CS
ICS3d inputCS = (ICS3d)(new DSCGEOMCOMLib.CS3d());
inputCS.ZAxis = yAxis;
25
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
For welded beams same as compound beam. Only section.className and section.Name differ.
Example: sectionClass =”WeldedIAsymmetric”, sectionName = “Default”
3.2.2 Plates
26
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//create polygon
IAugPolygon3d polygon = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon.AppendNewVertex(p1, vertexInfo, true);
polygon.AppendVertex(p2);
polygon.AppendVertex(p3);
polygon.AppendVertex(p4);
polygon.AppendVertex(p5);
//plate thickness
double plateThickness = 10;
//create plate
IPlate platePoly = m_Joint.CreatePlatePoly((AstSTEELAUTOMATIONLib.Role)plateRole,
polygon, plateThickness);
//set here all the properties which can be modified outside the joint
jointTrans.set_Attribute(eAttributeCodes.kPlateDenotation, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMaterial, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateCoating, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSinglePartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMainPartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSinglePartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMainPartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateAssembly, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateItemNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSinglePartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMainPartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateNote, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSPUsedForNumbering, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSPDisplayRestriction, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateSPExplicitQuantity, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMPUsedForCollisionCheck, 1);
27
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
jointTrans.set_Attribute(eAttributeCodes.kPlateMPUsedForNumbering, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMPDisplayRestriction, 1);
jointTrans.set_Attribute(eAttributeCodes.kPlateMPExplicitQuantity, 1);
}
xAxis.Create(1, 0, 0);
yAxis.Create(0, 1, 0);
zAxis.Create(0, 0, 1);
28
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//create polygon 1
IAugPolygon3d polygon = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon.AppendVertex(p1);
polygon.AppendVertex(p2);
polygon.AppendVertex(p3);
polygon.AppendVertex(p4);
jointTransfer.ClassType = eClassType.kPlateFoldedClass;
jointTransfer2.ClassType = eClassType.kPlateFoldRelationClass;
//plate thickness
double plateThickness = 10;
//create polygon 2
IAugPolygon3d polygon2 = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon2.AppendVertex(p1b);
polygon2.AppendVertex(p2b);
polygon2.AppendVertex(p3b);
polygon2.AppendVertex(p4b);
//create polygon 3
IAugPolygon3d polygon3 = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon3.AppendVertex(p1c);
polygon3.AppendVertex(p2c);
polygon3.AppendVertex(p3c);
polygon3.AppendVertex(p4c);
29
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//create polygon 4
IAugPolygon3d polygon4 = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon4.AppendVertex(p1d);
polygon4.AppendVertex(p2d);
polygon4.AppendVertex(p3d);
polygon4.AppendVertex(p4d);
//create polygon 5
IAugPolygon3d polygon5 = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon5.AppendVertex(p1e);
polygon5.AppendVertex(p2e);
polygon5.AppendVertex(p3e);
polygon5.AppendVertex(p4e);
//create polygon 6
IAugPolygon3d polygon6 = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
polygon6.AppendVertex(p1f);
polygon6.AppendVertex(p2f);
polygon6.AppendVertex(p3f);
polygon6.AppendVertex(p4f);
30
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
if (foldedPlate != null)
{
createdObjectsArr.Add(foldedPlate);
int stringerID2;
PlateFoldRelation plateFoldRelation;
bool ok;
//extend the folded plate to the second created plate and get the Relation between the 2
plates
ok = foldedPlate.ExtendBy((AstSTEELAUTOMATIONLib.PlateFold)platePolyFold2, 1,
stringerID, p1, p3b, relationRole, out stringerID2, out plateFoldRelation);
foldedPlate.JointTransfer = (AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer;
if (platePolyFold3 != null)
{
ok = foldedPlate.ExtendBy((AstSTEELAUTOMATIONLib.PlateFold)platePolyFold3, 1,
stringerID, p2, p2c, relationRole, out stringerID2, out plateFoldRelation);
if (plateFoldRelation != null)
{
plateFoldRelation.JointTransfer =
(AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer2;
createdObjectsArr.Add(plateFoldRelation);
plateFoldRelation.Radius = 10; //set the radius
}
}
if (platePolyFold4 != null)
{
ok = foldedPlate.ExtendBy((AstSTEELAUTOMATIONLib.PlateFold)platePolyFold4, 1,
stringerID, p1, p2d, relationRole, out stringerID2, out plateFoldRelation);
if (plateFoldRelation != null)
{
plateFoldRelation.JointTransfer =
(AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer2;
createdObjectsArr.Add(plateFoldRelation);
plateFoldRelation.Radius = 10; //set the radius
}
}
if (platePolyFold5 != null)
{
31
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
ok = foldedPlate.ExtendBy((AstSTEELAUTOMATIONLib.PlateFold)platePolyFold5, 1,
stringerID, p3, p4e, relationRole, out stringerID2, out plateFoldRelation);
if (plateFoldRelation != null)
{
plateFoldRelation.JointTransfer =
(AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer2;
createdObjectsArr.Add(plateFoldRelation);
plateFoldRelation.Radius = 10; //set the radius
}
}
if (platePolyFold6 != null)
{
ok = foldedPlate.ExtendBy((AstSTEELAUTOMATIONLib.PlateFold)platePolyFold6, 1,
stringerIDFold2, p1b, p1f, relationRole, out stringerID2, out plateFoldRelation);
if (plateFoldRelation != null)
{
plateFoldRelation.JointTransfer =
(AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer2;
createdObjectsArr.Add(plateFoldRelation);
plateFoldRelation.Radius = 10; //set the radius
}
}
}
}
}
3.2.3 Features
The basic objects (i.e., beams and plates) have available processing features. The most important
processing types are:
Beam processing: coping, miter cuts, rectangular and circular contour cuts, or any type of
contour.
Plate processing: corner finishes, chamfers, outer plate contours and inner contours, etc.
Processing of existing basic objects (e.g., beam trimming and coping) is displayed as green
processing contours within the object. The processing objects cannot exist alone and are part of a
basic element (i.e., beam or plate). The object processing are edited as individual objects.
The variety of processing options in Advance Steel allows for almost any beam and plate contour.
If a basic element is deleted all processing objects will also be deleted.
32
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
33
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
p1.setFrom(startPoint);
movePoint(p1, inputBeam.PhysicalCSStart.ZAxis, dHeight / 2, out p1);
movePoint(p1, inputBeam.PhysicalCSStart.YAxis, dWeb / 2, out p1);
movePoint(p1, inputBeam.PhysicalCSStart.YAxis, (dWidth - dWeb) / 2, out p2);
movePoint(p2, xAxis, -100, out p3);
movePoint(p1, xAxis, -100, out p4);
//compute contour
IAugPolygon3d contourNotch = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
contourNotch.AppendVertex(p1);
contourNotch.AppendVertex(p2);
contourNotch.AppendVertex(p3);
contourNotch.AppendVertex(p4);
34
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
p1.setFrom(startPoint);
movePoint(p1, inputBeam.PhysicalCSStart.ZAxis, dHeight / 2, out p1);
movePoint(p1, inputBeam.PhysicalCSStart.YAxis, dWeb / 2, out p1);
movePoint(p1, inputBeam.PhysicalCSStart.YAxis, (dWidth - dWeb) / 2, out p2);
movePoint(p2, xAxis, -100, out p3);
movePoint(p1, xAxis, -100, out p4);
//compute contour
IAugPolygon3d contourNotch = (IAugPolygon3d)(new DSCGEOMCOMLib.AugPolygon3d());
contourNotch.AppendVertex(p1);
contourNotch.AppendVertex(p2);
contourNotch.AppendVertex(p3);
contourNotch.AppendVertex(p4);
u0.setFrom(p1);
double dFlange = profType.getGeometricalData(eProfCommonData.kFlange);
movePoint(u0, inputBeam.PhysicalCSStart.ZAxis, -dFlange - 1e-3, out u1);
IBeamMultiContourNotch multiContourNotch =
inputBeam.addBeamMultiContourNotchClip((AstSTEELAUTOMATIONLib.Role)notchRole,
eBeamEnd.kBeamStart, contourNotch, u0, u1);
35
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
}
}
addChamfer(double a_val, double b_val, int VertexIndex) - Returns and creates a Chamfer
object. The plate corner is identified by the vertexIndex.
addFillet(double rad_val, eFilletTypes fillet_type, int VertexIndex) - Returns and creates a Fillet
object. The plate corner is identified by the vertexIndex. For information about possible values of
eFilletTypes, see the Appendix (“Advance Steel Developer Guide”).
36
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Objects that are not Advance Steel standard objects can be created as special parts . When Advance
Steel creates drawings and bills of material with special parts they are handled like standard objects.
If these objects (special parts) are to appear in the bill of material, they must be provided with
Advance Steel properties.
CreateSpecialPart(Role pRole, double Scale, string BlockName, ICS3d pCS) - Creates and
returns an SpecialPart object. For insertion point, the inputCS origin must be correctly specified.
37
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
createdObjectsArr.Add(specialPart);
}
}
3.2.5 Gratings
CreateStandardGrating(Role pRole, string strClass, string strSize, ICS3d cs) - Returns a grating
object. The grating’s className and sectionName are the internal names.
section.className = value from AstorGratings.GratingStandardMaster, column ClassName
section.size = from the definition table for className, value of column Name.
IGrating grating =
m_Joint.CreateStandardGrating((AstSTEELAUTOMATIONLib.Role)gratingRole, sectionClass,
sectionSize, cs);
38
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
The basic objects (i.e., beams and plates) can be connected with:
Bolt patterns (or holes only)
Welds
Anchors
These objects establish a connection between objects (e.g., beams and plates). This information is
stored on the objects (i.e., beam or plate) including any bolt pattern (with its definition) or welds (with
its relevant properties). Any individual element in the connection “knows” what holes, bolts, or welds it
contains or with which element it is connected.
A bolt pattern can describe one or several bolts, which are automatically created in any plane together
with the appropriate holes.
CreateBoltFinitRect(Role pRole, string Material, string norm, double wx_dim, double wy_dim,
double dx_dim, double dy_dim, double nx_dim, double ny_dim, double diameter, ICS3d
coordSys) - Returns a Bolt object. Create a bolt pattern of type finite, rectangular.
39
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//set here all the properties which can be modified outside the joint
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonGripLengthAddition, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonHoleTolerance, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonCoating, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonDenotation, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonAssembly, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonItemNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonInvertAble, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonNote, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonIgnoreMaxGap, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonSPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonSPUsedForNumbering, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonSPUsedForBillOfMaterial, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonSPExplicitQuantity, 1);
jointTrans.set_Attribute(eAttributeCodes.kBoltPatternCommonRole, 1);
}
40
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
private void AddWeld (ref AstObjectsArr createdObjectsArr, IPlate basePlate, IBeam inputBeam)
{
//create new role object
IRole weldRole = m_Joint.CreateRole("Weld");
createdObjectsArr.Add(weld);
//connect objects
AstObjectsArr conObj = m_Joint.CreateObjectsArray();
conObj.Add(inputBeam);
conObj.Add(basePlate);
weld.Connect(conObj, eAssembleLocation.kInShop);
}
}
41
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
weldBevel = platePoly.addPlateWeldingBevel((AstSTEELAUTOMATIONLib.Role)weldRole,
edgeIndex, xDist, yDist, plateSide);
if (weldBevel != null)
createdObjectsArr.Add(weldBevel);
}
42
4 Chapter 4
Joints API
4.1 User interface
The joint with its attributes is controlled by a property sheet dialog box. This means, that this dialog
box will appear during creation and modification. It exposes the joint category, the type, and all the
joint attributes. One default page appears in every property sheet dialog box.
The Type page contains a runtime list of all types of this category. It allows for switching between
types.
The Update contains a check box indicating whether this joint should be updated automatically or not
(which means that the user will be informed).
The rule designer has to design all other pages. This is done by implementing the GetUserPages
method of the IRule.
The relationship between joint type and category is represented by a table in the database
AstRules.mdf. The rule designer has to create entries there in order to create this relationship.
The Query method implementation should use the provided AstUI object and get user input regarding
necessary parameters or objects. The objects must be added to the Joint.InputObjects. The selected
objects will become “driver objects” for the joint. Modification of the “driver objects” will instigate an
update of the Joint.
Also, if the rule is called using _astm4commstructasJointVB box _RuleName there is always a
structural box inside the InputObjects array at the beginning of the Query method.
CreateObjects method implementation should create AS objects and add them to the CreatedObjects
of the Joint. The objects can be created by using the methods of the Joint object. Once the objects
are created they are automatically added to the drawing. The connection between them and the Joint
object is done after they are added to the Joint.CreatedObjects. Although is possible to create objects
without add them Joint.CreatedObjects is wrong to do that because in that case connection is not
created and those object are “out of joint”. They will not be erased when updating the joint and other
will be created.
Advance Steel will call the OutField method every time is necessary to get the values and/or the
names of the Rule attributes. Similarly will call the InField method every time is necessary for the Rule
to change its current attribute values. For example calls to these methods will happen when a dwg
containing a joint created with this Rule is opened/saved, when the user changes the joint parameters
in the joint properties dialog box, etc.
By implementing this method you are able to specify the GUI of this Rule. This method should return
handles to the created windows. The windows will become property pages for the Rule dialog box.
Also here you should assign the corresponding prompts for the Rule dialog box title and for the
PropertyPages titles.
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
4.5.1.1 Example
//Set Title(From AstCrtlDb.ErrorMessages)
pPropSheetData.SheetPrompt = 81309;
//Property Sheet 1
RulePage rulePage1 = m_Joint.CreateRulePage();
rulePage1.title = 88438; //Base plate layout
m_Page1 = new Page1(this);
rulePage1.hWnd = m_Page1.Handle.ToInt64();
pagesRet.Add(rulePage1);
4.7 GetExportData
By implementing this method the Rule can specify the necessary external data for the Rule to run.
Based on this information a tool is able to import/export data from/into Advance Steel databases
4.8 GetFeatureName
Must return true or false depending on license feature usage for this rule.
4.9 FreeUserPages
4.10 Libraries
Advance Steel provides several libraries that are intended to be used when implementing a Rule.
AstSteelAutomation library – provide access to all Advance Steel dwg objects.
DSCGeomCom library – Geometry library, useful for geometric calculation (vectors, coordinates,
points, parametric curves)
DSCProfilesAccesCom library – Provides access to the profiles defined used by Advance Steel.
DSCUtilFacetCom library - Provides access to the geometric body of an Advance Steel object.
DSCOdbcCom library - Provides access to data used by Advance Steel and stored in external
databases.
AstControls library – Provides several controls intended to be used for the GUI of the joints.
Mainly this library has regular controls but uses database prompts (language dependent) instead of
hardcoded prompts. Also this library has a Bitmap control that uses bitmaps stored in AstorBitmaps or
in dll’s.
45
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Whenever you need to create and Advance Steel object you should define a new IRole object. This
object is used to identify object from model. To create a role you need to assign a name from
AstorBase database, table ModelRole corresponding to your object.
4.12 JointTransfer
This object will be passed after it is created to almost all of the methods that create Advance Steel
objects. The joint transfer has mainly two “visible” applications: identify objects with identical geometry
and properties and set which of the properties of joint created objects can be set by the user outside
of the joint.
To define a complete joint transfer means to assign a name, the class type of the objects it will be
applied to and to define which of the object’s properties will be editable outside the joint.
After setting the object class type, you have to specify which will be the editable attributes. In Visual
C# syntax, this is what you have to do:
//set here all the properties which can be modified outside the joint
jointTransfer.set_Attribute(eAttributeCodes.kBeamMaterial, 1); //means the beam material can be
set outside the joint
jointTransfer.set_Attribute(eAttributeCodes.kBeamCoating, 1); //other editable properties of object
with this joint transfer
If a joint transfer attribute should not be modified outside the joint (this is the default state of attributes
– read only), you could use: jointTransfer.set_Attribute(eAttributeCodes.kBeamMaterial, 0); //means
the beam material cannot be set outside the joint
46
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
The definition record in HRLDefinition requires the specification of the GUID on the ClassID column.
4.13.1.1 Relationships
AutoCAD
AstorRules.HRLDefintion
Key RuleRunName InternalName Category Dll SubNameInDll ClassID
200000 Create Plate CreatePlate CreatePlate 1000 CreatePlate {DFB7A86F-7E86-40F2-8E58-
C16C776F7464}
AstorRules.RulesDllSigned table
Key FileName x86 Filename x64
1000 SampleJoint.dll
For joints created in pure .Net (without COM technology) the SubNameInDll field should contain the
fully qualified name of the class. E.g.: SampleJoint.CreatePlate (where SampleJoint is the namespace
and CreatePlate is the class name). Also for joints created in pure .Net the ClassID field should be a
new generated GUID.
Each joint can store its parameters to database. This is useful when you need to create the joint for
many times. You need to configure joint one time and then save its values to database. Then when
make a new joint will be created with this values. Joint table columns must be in order and with same
name like members from (InField/OutField).
In Query method after adding the input objects you can set parameters for joint (load from joint table
or initialize with some values).
//Search if joint table contain a record with "Default" name. If succeeded load values from that record.
int key = (int)odbcTable.Search();
if (-1 != key)
{
int idx = 2;
m_dPlateThickness = (double)odbcTable.GetAt(idx++);
//…
}
else
{
m_dPlateThickness = 10;
}
47
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
From menu Project choose Add Reference. In the Add Reference dialog box, click the Browse tab.
Locate the folder where Advance Steel is installed and select the following files:
48
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Interop.AstSTEELAUTOMATIONLib5.dll
Interop.DSCUTILFACETCOMLib.dll
Each of these libraries has a well-defined role in the joint development process and will be described
in the following brief descriptions.
AstSteelAutomation handles all the “core” Advance Steel functionalities. It exposes interfaces to
objects that can be created with Advance Steel and also handles joint, GUI and other functionalities.
AstControls is used mainly for GUI development of joints. Several ActiveX objects have been
provided with this library. For example the joint developer can link one static prompt to a CrtlDb
message through a StaticDbTextControl.
DSCUtilFacetCom mainly handles the body interface. It provides access to body intersection with
lines and other basic geometry interfaces.
DSCGeomCom handles basic geometry classes. This library can be used without Advance Steel. It
exposes interfaces like point, vector, plane etc.
DSCOdbcCom library provides useful and easy access to Advance Steel databases. One can get
prompts, defaults or easily access tables through interfaces provided by this library.
At this stage the project should have only one class (default named “Class1”). This can be renamed to
fit the joint’s name. Your class should inherit from IRule interface and IJointInfo.
You need to implement several methods/properties. To do that, right click on IRule and select
Implement Interface.
Query method
Is the function that is passed only once when the joint is run the first time. Its role is to ask the user for
input objects and set defaults.
//selection incorrect
if (errCode == eUIErrorCodes.kUIError)
return;
49
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
CreateObjects contains the joint functionality. It uses the global variables declared in the declaration
section and does the main work. The normal behavior when creating a new joint is to create objects in
the "CreateObjects()" method and show the property pages. Remember - when you show property
pages you should not force the update of the joint.
For the correct functionality of a joint when a problem has appeared and the box should be red, the
joint should implement the CreateObjects method as follows:
try
{
//…creation stuff…..
}
catch (COMException ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
bCreationStatus = false;
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
bCreationStatus = false;
}
50
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
From Visual Studio menu, select (Tools/Create GUID). Select Registry Format and click Copy. Then
add the following lines to you project before class name
[ComVisible(true)]
[Guid("paste generated GUID here")]
After completing the code, you must build the project. From the Build menu, click Build Solution.
Table structure:
Key
RuleRunName - The name that would appear on joint property sheet
InternalName - Command name used to call joint
Category - Joint category
Dll - Key to RulesDllSigned table
ClassID - Generated GUID
Add new record
51
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Table structure
Key - number from HRLDefinition.Dll
FileName - DLL name.
Tech – Possible values are: 0 – for C++ COM, 1 – for COM in .NET, 2 – for pure .NET .
Add new record
When you need to add a new prompt, use numbers from this range.
The joint with its attributes is controlled by a property sheet dialog box. This means, that this dialog
box will appear during creation and modification. It exposes the joint category, the type, and all the
joint attributes.
The rule designer has to design all pages. This is done by implementing the GetUserPages method of
the IRule.
GetUserPages provides the link between the ActiveX class object created and forms created for the
GUI. The joint developer is responsible for creating GUI forms for the joint. Each form represents one
property sheet in the Joint Properties tab.
InField should contain persistent data reading from the dwg. In the InField function there should be
calls to pFiler.readItem like:
m_dPlateThickness = (double) pFiler.readItem("PlateThickness");
Please note that the “PlateThickness” string is important and should be exactly the same in the
reverse operation,
Outfield: pFiler.writeItem(m_dPlateThickness, "PlateThickness")
52
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
53
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
AstUnitControl
EditType: Length, Angle, Area, Weight, Volume, Double Adimensional, Integer Adimensional
and String
LabelDbkey: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
54
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
AstComboTableControl
LabelKey: Prompt number from database(AstCrtlDb, table ErrorMessages)
LabelLength: Control length
TableName: Link to table name from AstorRules database
ComboIndex: Order of runname in list, starting from 0 - not the key of the table record
ComboCaption: Displayed runname
StringLey: Key of record for current runname - use ONLY when table has a string key
LongKey: Key of record for current runname - use ONLY when table has an integer key
AstBitmapControl
Key: AstorBitmaps. BitmapIndex table
AstCheckBoxControl
CaptionKey: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
Value: Control value
Enable: True/False
AstBoltStandards
BoltStandard: Bolt type
BoltMaterial: Bolt material
BoltSet: Bolt assembly
BoltDiameter: Bolt diameter
LabelStandard: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
LabelMaterial: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
LabelBoltSet: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
LabelDiameter: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
ElementType: Bolt, Shear stud, Anchor
LabelLength: Control length
AstProfileControl
CaptionClass: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
CaptionShowHideAllSection: UPS Prompt number from database (AstCrtlDb, table
ErrorMessages)
CaptionTyp: UPS Prompt number from database(AstCrtlDb, table ErrorMessages)
CurrentClass: Value from AstorProfiles.ProfileMasterTable, column TypeNameText
CurrentSection: From the definition table for className, value of column SectionName
AstWeldControl
LabelDbKey: Prompt number from database(AstCrtlDb, table ErrorMessages)
LabelLength: Control length
SelectItemByKey: Control value
55
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
56
4.15.10 Making the joint available in Revit
Currently Advance Steel joints are available in Revit under the Steel Connections addon. Any third
party Advance Steel joints require the installation of the Steel Connections addon in Revit in order to
work. Also they have to be installed in Revit, in Addons\SteelConnections sub folder together with the
other Advance Steel components.
After creating a joint and making it available in AdvanceSteel (under AutoCAD), there are some
special steps required in order to make it available in Revit too:
add info about the new joint in SteelConnectionsData.xml similar to what you have for the other
joints
- make sure the typeId field from the xml has the same guid as the classId
from AstorRules.HRLDefinition table.
- fill the Images and PreviewText with the names of your corresponding resources
Example:
<PaletteItem>
<Description>Sample joint</Description>
<Command>samplejoint</Command>
<PreviewText>Preview text for the sample joint</PreviewText>
<Images>
<string>SampleJointImage.png</string>
</Images>
<PreviewImages>
<string>SampleJointPreviewImage.png</string>
</PreviewImages>
<TypeId>DFB7A86F-7E86-40F2-8E58-C16C776F7464</TypeId>
<ShowSectionMaterial>false</ShowSectionMaterial>
<ShowWeldType>false</ShowWeldType>
<ShowWeldThickness>false</ShowWeldThickness>
</PaletteItem>
- add the resource dll name ( the one that contains the image and preview image for the joint)
to the ResourceDll and PreviewResourceDll fields. The resources dll names should be
separated with a comma (“,”) from the existing dll names.
Example:
<ResourceDll>ASConnectionsResources.dll,SampleJointDotNetResources.dll</ResourceDll>
<PreviewResourceDll>ASConnectionsPreviews.dll,SampleJointDotNetResources.dll</PreviewResourceDll>
update table AstorRules.AutoFilteringConfig with information about the new joint
Example:
Key 999999
Category SampleJoint
RunName ColOrRaf Any to ColOrRaf Any
InputSet Any+Any
InputSetConds No Condition
RuleInternalName SampleJoint
ObjectsOrderForJoints 2 Beams inversed
OwnerText
For more information about configuring the AstorRules.AutoFilteringConfig please check the
following document: "AstorRules set up for SteelConnection Project.docx"
installation (joint dll, dot net resources dll and all the AS databases and xml-s updated for all the
languages). Currently the Steel Connections addon is installed in 4 languages; so the databases
and SteelConnectionsData.xml for each country has to be updated accordingly.
The path to the SteelConnections binaries should be composed from the Revit install location read
from Registry Keys (e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\Revit\2018\REVIT-
05:0409\InstallationLocation) and the relative path to the Revit Addins (AddIns\SteelConnections).
The result should be something like this:
“C:\Program Files\Autodesk\Revit 2018\” + “AddIns\SteelConnections”.
Install location
From registry key HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R22.0\ACAD-1026
read the value of “BinPath”. Navigate to the obtained folder (eg. C:\Program Files\Autodesk\AutoCAD
2018\ADVS\ ); here you should copy the joint dll.
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
5 Chapter 5
Joints Design API
59
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
60
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
We will describe below the main methods which need to be implemented for a calculation module and
the type of actions which should be performed when each of them is called by Advance Steel.
ModuleName - You need to return from this method the internal name of the calculation module,
as it was specified in the database during configuration.
Standard - Currently, from the get method you need to return “Default”.
GetExportName() -This method is called to obtain the string required to complete the text
displayed in the “Joint Design” sheet on the button “Export”. Example: return “to my app” will
make the “Export” button display the “Export to my app” text.
GetImportName() -This method is called to obtain the string required to complete the text
displayed in the “Joint Design” sheet on the button “Import”.
GetLastReportFilename(bool bQuickReportFilename) - On the “Joint Design” sheet, after a
check or presize operation, reports should be available in order to see the results of the
calculation. This method must return the full path of the last created quick report and detailed
report files. Depending on the values of the input parameter “QuickReportFilename” you must
return true (the quick report file path) or false (the detailed report file path).
CheckJoint() - This method is called in two situations:
When you press the “Check” button from “Joint Design” sheet.
When the joint updates, if the checkbox “Automatic checking” is checked.
After the check operation is finished, you need to return the joint status, depending on the
results returned by the calculation engine (the joint is correctly designed, incorrectly designed
or not possible to calculate).
PresizeJoint() - This method is called when the “Presize” button is pressed. You need to pass
required parameters to the calculation engine, read back the results and set the new
configuration of the joint, as well as returning the new status of the joint (correctly designed,
incorrectly designed or impossible to calculate).
ImportJoint()/ExportJoint () - Each method is called when the “Export”, respectively “Import”
buttons are pressed. In case of export: you need to save the current joint configuration in a
format which can be read by the calculation engine. In case of import: you need to set the joint
parameters to the corresponding values, depending on the imported data, which has been
created previously by the calculation engine. You must to display the “Save As…” or “Open…”
dialogs when the methods are called.
GetUserPages(RulePageArray pagesRet, PropertySheetData pPropSheetData) - Called when
the “Torsors” button is pressed – you need to prepare the dialogs which display the
efforts/loadings from the Node (if it exists) and also allow the creation of new sets of
efforts/loadings.
GetUserTorsorsPage(RulePage pageRet) - Called when the “Joint Design” sheet is displayed.
You need to prepare the display of the “torsor” values on the “Joint Design” sheet.
GetUserSettingsPages(RulePageArray pagesSettingsRet, PropertySheetData pPropSheetData)
- Called when the “Settings” button is pressed. You need to prepare the dialogs which allow the
setting of other data required by the calculation engine (other than efforts and joint parameters) -
like detailed report format (TXT, RTF …), reports creation (only in certain conditions, like
calculation failed), etc…
61
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
In addition to the implementation of the INodeStressAppModule interface, the joint calculation module
requires the use of an object of IStressModuleJoint type.
62
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
In order to attach a joint calculation module to a joint, you need to create records for the calculation
module in the AstorJointsCalculation.mdf database.
JointInternalName - Key to AstorRules.HRLDefinition table
NSAModuleInternalName - Key to AstorJointsCalculation.NSAModuleDefinition
DefaultModule - 1
ClassID - GUID from “CreatePlateDesign” class
5.1.5.1 Relationships
AstorJointsCalculation.NSAModule table
Key StressAnalysisCodeI JointInternalName NSAModuleInternalName DefaultModule
D
1 0 CreatePlate CreatePlateNSAModule 1
AstorJointsCalculation.NSAModuleDefinition table
Key ModuleRunName InternalName NSAModuleDll ClassID
1 My module CreatePlateNSAModule 12 {C64ECF63-D01C-451F-B0E0-E3F85DFAC05E}
AstorJointsCalculation.NSAModuleDllSigned table
Key FileName x86 FileName x64
12 SampleDesign.dll
63
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
//report format
int nReportFormat = (int)getJointNSAModuleSpecificData(m_joint, this, "ReportFormat", 0);
//get efforts
List<double> dM, dN, dV;
List<string> sCaseName;
getEfforts(m_joint, m_joint.GetJointNSAModuleLoadingCases(this),
m_joint.UseDetailedTorsors, out dM, out dN, out dV, out sCaseName);
return ret;
}
Generate GUID
[ComVisible(true)]
[Guid("C64ECF63-D01C-451F-B0E0-E3F85DFAC05E")]
After completing the code, you must build the project. From the Build menu, click Build Solution.
Go to C:\ProgramData\Autodesk\Advance Steel 2018\USA\StressAnalysis\Data\ (or your
currently installed country folder) and open AstorJointsCalculation database.
64
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
65
6 Chapter 6
Advance Steel Scripting Possibilities
6.1 Advance Steel Lisp API
Before creating the project documentation (drawings, BOMs, etc.), the structure must be numbered.
The basis for numbering is finding identical parts that should have the same mark.
Each object in Advance Steel has two part marks: a Single Part number and an Assembly part
number. The basis for numbering is finding identical parts that should have the same mark.
Single Parts and Assemblies are automatically numbered for the entire model.
The elements are compared by geometry, material properties, coating, and commodity (and
behavior). The properties name and lot/phase are not considered for numbering. The Model Role is
used by the prefix tool to assign prefixes but it is not used directly for numbering.
6.2.1 Workflow
At first, all structural parts should be numbered so start with single part marks.
The program then determines the assembly marks for parts connected in the shop. The biggest
part of an assembly is the main part and will get an assembly mark and all other parts are
considered attached and will have a single part mark.
Standard parts are numbered using additional options. Any part in the current model that
matches a Standard Part in the template will get the same mark (single part mark or assembly
mark, according to the situation).
During the numbering process beams and then plates are the first to be numbered. In each case, the
group with the most elements will get the lowest number.
A Standard Part Template makes a particular item or group of items have assigned a fixed part mark.
Standard parts are created in a template model using normal Advance Steel functionalities and then
assigned required part marks. During a numbering process objects are compared to detect identical
parts. Any part of the current model that matches a Standard Part in the template will get the same
mark.
The standard part template can be reused for any other project or new standard part templates can be
created if necessary.
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
In a steel structure, to make the difference between single parts and assemblies, prefixes can be used
to have distinct part marks.
Prefixes can be manually assigned, separately for parts and assemblies, or automatically assigned
during the numbering process, according to the model role of the model elements (e.g.: beam,
column, rafter, plate, etc.).
Main part assignment is either performed manually or by the numbering process using Create main
part of assembly that automatically detects attached parts. Alternatively, during assembly numbering,
the biggest part automatically becomes the main part.
There are few methods for numbering available in Numbering - General tab.
The first three numbering methods assign fixed numbers to the objects. There will be no link between
the assigned element number and the drawing the piece is detailed on.
SP: 1000, 10001, ...; MP: 1,2,3: The Single parts and the Main parts are numbered starting with
the defined value.
SP: 1000, 10001, ...; MP: 1000, 1,2,3: The Single parts and the Main parts are numbered
starting with the defined value. The standalone parts are numbered using same numbering rule
defined for the Single parts.
SP: 1/1 ..1/32..3/32;MP:1/1..: The Single parts and the Main part mark contains the number of
identical parts.
With drawing number: Assigns an internal number to each object. During the detail creation, the
internal number will be changed to the drawing number the element is detailed on. At drawing
creation, the first part gets the prefix a001, then b001, etc.
69
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
70
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
Number = StartAt
Number = PositionMarkCreator.AddZerosToPartMark(Number)
Do Until PositionMarkCreator.isUniqueInTheModel(kBoth,
EqualPartObject.SinglePartPrefix & Number)
StartAt = StartAt + Delta
Number = StartAt
Number = PositionMarkCreator.AddZerosToPartMark(Number)
Loop
PositionMarkCreator.UpdateStartAtForSinglePartsWithPrefix
EqualPartObject.Type, EqualPartObject.SinglePartPrefix, StartAt+Delta
End If
getNumber = Number
End Function
6.3.1 Overview
Upon building a 3D model, dimensioned and labeled 2D general arrangement and shop drawings can
be automatically created. The drawings are created in separate DWG files from the model, however
they are linked to track changes.
The model knows which drawings have been linked and checks if these drawings still correlate. Thus,
the drawings can be updated after any model modifications. This link is ‘one way’ and changing a
drawing will not modify the model.
A drawing may consist of several linked details, which are individual Advance objects with their own
properties.
Advance offers a variety of drawing styles for general arrangement drawings, sections, and shop
drawings in various designs. The drawing style is a group of instructions used to create a detail
71
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
drawing and defines the selection of the elements that are to be displayed including labeling and
dimensioning preferences.
The drawing styles provide the option to automatically create drawings and to modify the layout
exactly to user requirements. Drawing styles are used in a similar way to standard CAD dimension
styles, line styles, etc.
The styles are defined with various settings (e.g., parts to be displayed, view, dimensions, labeling,
representation etc.) in MS Access tables (libraries).
Example:
'Script to filter " C" profiles only
Function checkElement(Obj)
checkElement = False
'Be sure the object is a beam.
If Obj.Type = kBeamStraightClass OR Obj.Type = kBeamPolyClass Then
'Get the name of the profile and convert it to upper letters.
ProfName = Ucase(Obj.getProfType.getSectionName)
'Check if the name contains "C".
If InStr(ProfName, "C") Then
checkElement = True
End If
End If
End Function
72
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
6.4.1 Overview
To accelerate the drawing creation by automatically assigning drawing styles and layouts for the
selected parts, drawing processes are used.
Drawing processes automatically create part drawings (using appropriate drawing styles) and arrange
the created details within a drawing (.dwg) or across several drawings. A drawing process will step
through all the selected objects, choose a suitable Drawing Style and create a drawing of the object,
then move on to the next object. In this way many drawings of many objects can be created quickly
and easily.
Selection of parts
Sorting, selection of an appropriate drawing style based on the object type and model role
Selection of the appropriate prototype
Rules for arranging details on the sheet: several drawing scales are tested to find the best fit on
the sheet. The actual scales tried are defined within the Process. If multiple sizes are allowed all
scales will be tried on the smallest sheet first then all scales on the next sheet size and so on
working up. If a single sheet size is selected and none of the scales fit the border the views will
be still created at the smallest scale on the given sheet.
Rules to attach new sheets.
Automatically naming the file
Example:
'Returns true for bolts connected On Shop
Function checkElement(Obj)
bOnShop = False
If Obj.IsKindOf(kScrewBoltPattern) = True Then
'See if bolt is On shop
If Obj.AssemblyLocation = kInShop Then
bOnShop = True
End If
End If
73
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
checkElement = bOnShop
End Function
From the model information an extract is created which is used to generate reports. The model extract
can be pre-processed using XSL transformation. XSLT files are stored in
C:\ProgramData\Autodesk\Advance Steel 2018\USA\Shared\Support\Transformations\ (or your
currently installed country folder) folder.
In order to pre-process the model extract xml file user has to create the XSL file and save it in the
Transformation folder, assign the XSLT file to the report template in BOM Editor and save the
template.
When a report is generated the XSL transformation is applied to the selected model extract and the
resulted extract is then used by the BOM tool.
Example: The Cladding list report template uses Cladding list.xslt in order to preprocess the cladding
profiled which contain additional information (set via Cladding joint dialog) about the inside/outside
coating, number of bolts needed to fix the profile.
74
ADVANCE STEEL COM API DEVELOPER TRAINING GUIDE
75