How to use Advance Steel nodes in Python script

Is there a way to use Advance Steel nodes in a Python script?
What do I need to import / add reference in order to use the StraightBeam.ByStartPointEndPoint node in a Python script, for example?

Hi! Here is a python code that creates a steel beam:

import sys
import clr

clr.AddReference(“AdvanceSteelNodes”)
from AdvanceSteel.Nodes.Beams import *

beam = StraightBeam.ByStartPointEndPoint(IN[0], IN[1], IN[2])

OUT = [beam]

5 Likes

Hi @Vlad_Pavel
What are “AdvanceSteelNodes”?
Are they wrappers around NET Advance Steel API?

Instead of them, can we directly use Advance Steel API inside the python node?
import Autodesk.AdvanceSteel.Geometry

Hi! Yes, “AdvanceSteelNodes” is a dll that exposes Advance Steel API as nodes in dynamo.

You can use directly Advance Steel API but I do not recommend it because in some situations you will not get the management done by Dynamo for Advance Steel - units conversion, automatic transaction per script run, link between dynamo nodes and Advance Steel objects. Using only Advance Steel Geometry API from python should be ok.

Dynamo for Advance Steel is an open source project and you can find the code for AdvanceSteelNodes here Dynamo-Advance-Steel/src/AdvanceSteelNodes at master · DynamoDS/Dynamo-Advance-Steel · GitHub

1 Like

Thank you @Vlad_Pavel for the quick response!
My fear is that AdvanceSteelNodes" is currently a bit limited when it comes to creating connections between two beams.
By looking at the repository, I see only these connection types:

This is why I thought that maybe with the usage of actual AdvanceSteel API (and not AdvanceSteelNodes) in dynamo node - we can extend the number of supported connections.