Placing beams with python scripts

Greetings,

I am working with Advance Steel and would like to create complex structures using Dynamo and Python (I have already done similar things using Revit, Dynamo and Python). I have troubles placing beams using the Beams.StraightBeam.ByStartPointEndPoint() function. The problem is that only the last beam is visible in the AdvanceSteel GUI (in Dynamo’s 3D preview, both lines representing the two beams are visible).

Does anybody know what is the problem, please see the bellow code of the Python Script (I would attach a minimal working example, however as a new user, I am not allowed). Only the last beam is placed in Advance Steel.

import sys
import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('AdvanceSteelNodes')
from AdvanceSteel.Nodes import *

# POINTS
P1a = Point.ByCoordinates(0.0, 0.0, 0.0)
P1b = Point.ByCoordinates(0.0, 0.0, 1000.0)

P2a = Point.ByCoordinates(200.0, 200.0, 0.0)
P2b = Point.ByCoordinates(200.0, 200.0, 1000.0)

# BEAM TYPES
beamtype1 = Property.ByNameAndValue('Profile Name', 'U_Kalt nach DIN#@§@#U160/65X7')
beamtype2 = Property.ByNameAndValue('Profile Name', 'RHS rund EN10210-2 1990#@§@#RHSØ48.3x3.2')

# BEAMS
Beams.StraightBeam.ByStartPointEndPoint(P1a, P1b, Vector.YAxis(), 4, False, [beamtype1])
Beams.StraightBeam.ByStartPointEndPoint(P2a, P2b, Vector.YAxis(), 4, False, [beamtype2])

The only solution I found is to generate lists with data (points, orientation and properties) using Python Script and then input them into the standard StraightBeam.ByStartPointEndPoint node (here, for some reason, Auto lacing is not working, it must be set to Shortest or Longest).

I also tried copying the above code into Code Block node, without the imports and the last two lines modified to

StraightBeam.ByStartPointEndPoint(P1a, P1b, Vector.YAxis(), 4, false, [beamtype1]);
StraightBeam.ByStartPointEndPoint(P2a, P2b, Vector.YAxis(), 4, false, [beamtype2]);,

and it is working, however I am really hoping if someone has the solution for Python method.

I am using Advance Steel 2023 (product version 601) and Dynamo 2.13.1.3887 (add-on in Advance Steel).

Best regards

Hi Tomaz,
I have the same problem, I have even tried to see what nodes I can get out of AS nodes by running dir, but i get error, it works well in Revit.
image
Please tell me if you find the solution. it is better to have one python node then 100 dynamo nodes to do the same operation. :slight_smile:

Hello,

to list all nodes, you should run:

import sys
import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('AdvanceSteelNodes')
import AdvanceSteel as AS

nodes = dir(AS.Nodes)
beamnodes = dir(AS.Nodes.Beams)

OUT = nodes, beamnodes

For the above problem no solution has yet been found, except the workaround I have described (using one Python script to generate lists to be used as inputs to standard nodes).

Best regards

1 Like

Thanks Tomaz,
It is very helpful,
I find that I can use AS nodes.

Tomaz, I do not know how to Thank you, it is more than two weeks I was searching for this an i got confused since when i write AdvanceStee.Nodes.Beams and so an it shows me the option but it did not worked.