Structural Framing: Column By Curve with Python

I am trying to use Structural Framing: Column By Curve inside of the Python Script in dynamo (Inputs: Curves, Level, Structural Column Type), to give added loop and conditional control.

Would appreciate any help in this regard.

Take a look at this method in the Revit API. The less straightforward part is getting the particular FamilySymbol of the specific Type you are trying to model. Here’s some pseudocode to get you started (it may very well be valid Python but I don’t have access to Revit to try it out):

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
curve = UnwrapElement(IN[0]) # Assuming input is a Curve
member_type = UnwrapElement(IN[2]) # Assuming a single Type is provided
symbol = member_type.Symbol # Assuming member_type is FamilyInstance
level = UnwrapElement(IN[1]) # Assuming single Level is provided
structural_type = member_type.StructuralType

DocumentManager.Instance.EnsureInTransaction(doc)
doc.NewFamilyInstance(curve, symbol, level, structural_type)
DocumentManager.Instance.TransactionTaskDone()

@shakya , take a look here.

Hi Jean,

Could you possibly share your python script as well?

@shakya , code includes in this post, you can just copy & paste it .