Is it possible to prevent the beam from attaching automatically?

I am trying to extend an existing beam using Dynamo because I need to fill the space created by an opening. However, the beam is not extending to the desired length and is automatically attaching to a nearby beam. Is there a solution?

try this, if you want to do it in dynamo, try with below code or script

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Unwrapping Dynamo element to Revit element.
beams = UnwrapElement(IN[0])

#Disallow beam end joins in a transaction.
TransactionManager.Instance.EnsureInTransaction(doc)
for beam in beams:
        StructuralFramingUtils.DisallowJoinAtEnd(beam,0)
        StructuralFramingUtils.DisallowJoinAtEnd(beam,1)
TransactionManager.Instance.TransactionTaskDone()

OUT = 0


Disallow Join at Beam Ends.dyn (62.5 KB)