The optimal structural design is imperative in order to minimize material consumption and reduce the environmental impacts of construction. Given the complexity in the formulation of structural design problems, the process of optimization is commonly performed using artificial intelligence (AI) global optimization, such as the genetic algorithm (GA). However, the integration of AI-based optimization, together with visual programming (VP), in building information modeling (BIM) projects warrants further investigation. This study proposes a workflow by combining structure analysis, VP, BIM, and GA to optimize trusses. The methodology encompasses several steps, including the following: (i) generation of parametric trusses in Dynamo VP; (ii) performing finite element modeling (FEM) using Robot Structural Analysis (RSA); (iii) retrieving and evaluating the FEM results interchangeably between Dynamo and RSA; (iv) finding the best solution using GA; and (v) importing the optimized model into Revit, enabling the user to perform simulations and engineering analysis, such as life cycle assessment (LCA) and quantity surveying. This methodology provides a new interoperable framework with minimal interference with existing supply-chain processes, and it will be flexible to technology literacy and allow architectural, engineering and construction (AEC) professionals to employ VP, global optimization, and FEM in BIM-based projects by leveraging open-sourced software and tools, together with commonly used design software. The feasibility of the proposed workflow was tested on benchmark problems and compared with the open literature. The outcomes of this study offer insight into the opportunities and limitations of combining VP, GA, FEA, and BIM for structural optimization applications, particularly to enhance structural efficiency and sustainability in construction. Despite the success of this study in developing a workable, user-friendly, and interoperable framework for the utilization of VP, GA, FEM, and BIM for structural optimization, the results obtained could be improved by (i) increasing the callback function speed between Dynamo and RSA through specialized application programming interface (API); and (ii) fine-tuning the GA parameters or utilizing other advanced global optimization and supervised learning techniques for the optimization.