# Placing beams with python scripts

**URL:** <https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869>\
**Category:** Advance Steel\
**Tags:** python, dynamo\
**Created:** [April 24, 2023, 9:42am UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869 "2023-04-24T09:42:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomaz](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tomaz](https://forum.dynamobim.com/u/tomaz)\
**Post date:** [April 24, 2023, 9:42am UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869/1 "2023-04-24T09:42:48Z")

</div>

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.

```auto
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

```auto
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

---

<div class="post-metadata">

**Author:** ![javadqaitouri](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@javadqaitouri](https://forum.dynamobim.com/u/javadqaitouri)\
**Post date:** [April 30, 2023, 1:39pm UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869/2 "2023-04-30T13:39:41Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/8/082e8f57d7f19586c6b706d71371748f51e143c3.png)  
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. 🙂

---

<div class="post-metadata">

**Author:** ![tomaz](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tomaz](https://forum.dynamobim.com/u/tomaz)\
**Post date:** [May 5, 2023, 5:24am UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869/3 "2023-05-05T05:24:38Z")

</div>

Hello,

to list all nodes, you should run:

```auto
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

---

<div class="post-metadata">

**Author:** ![javadqaitouri](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@javadqaitouri](https://forum.dynamobim.com/u/javadqaitouri)\
**Post date:** [May 5, 2023, 9:14am UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869/4 "2023-05-05T09:14:31Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/7/5765d60caec8b0485d3cf1095dd7c62ab3d8ac31.png)

---

<div class="post-metadata">

**Author:** ![javadqaitouri](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@javadqaitouri](https://forum.dynamobim.com/u/javadqaitouri)\
**Post date:** [May 13, 2023, 9:08pm UTC](https://forum.dynamobim.com/t/placing-beams-with-python-scripts/88869/5 "2023-05-13T21:08:15Z")

</div>

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.
