I’m struggling with is how to add columns if there are no columns previously created in the model. If the model I open has already some column, this code works fine:
var columnPoint1 = new Point3d(1 + iSupports * dSupports, 1 + jSupports * dSupports, -3);
var columnPoint2 = new Point3d(1 + iSupports * dSupports, 1 + jSupports * dSupports, 0);
var columnEdge = new Geometry.Edge(columnPoint1, columnPoint2);
// Select Material
var materialDatabase = FemDesign.Materials.MaterialDatabase.GetDefault();
var columnMaterial = materialDatabase.MaterialByName("C30/37");
// Select Section
var sectionDatabase = FemDesign.Sections.SectionDatabase.GetDefault();
var columnSection = sectionDatabase.Sections.Section[140];
var columnSupport = new FemDesign.Bars.Column(columnEdge, columnMaterial, columnSection);
var columnList = new List<GenericClasses.IStructureElement>() {columnSupport};
nModel.AddElements(columnList);
This is the exception I get when the opened model has no previously defined column: