1. Introduction
In recent years, archaeological contexts and heritage assets have benefited from the successful application of open source solutions and custom environments for Historic Building Information Modeling (HBIM) projects [
1,
2]. FreeCAD software, based on the Python language, has proven to be a reliable solution for BIM and HBIM purposes. Informative platforms for building medieval archaeology as well as classical archaeology have been created by exploiting possibilities of open source solutions and customizable tools. Experiences carried out for the HBIM documentation of the Staffarda Abbey (CN, Italy) were extremely useful for integrating building archaeology stratigraphic analysis inside an open source HBIM environment built up via custom properties and plugins [
1,
3].
Another application of open source HBIM in the archaeological field was carried out for preserving and managing archaeological data related to the Domus Regia excavation site inside Parco Archeologico del Colosseo (Rome, Italy). Here, the HBIM documentation via open source solutions proved to be crucial for adapting 2D archaeological data to parametric elements of the hypothetical reconstruction of the religious building [
3,
4]. Furthermore, semantic historical data have been integrated through smart and ad hoc properties [
3,
4].
Open solutions and coding languages applied to a customized Common Data Environment (CDE) have made it possible to create a smart HBIM environment for managing and sharing archaeological data [
5]. In this regard, the ARK-BIM platform [
6] was designed for the following purposes: to manage HBIM models and associated data in an intelligent and user-friendly online environment and to make remote consultation and revision of archaeological models and data (resources, properties, and databases) possible [
3,
5,
6]. The BIM Collaboration Format (BCF) option, the ad hoc plugins, and the real-time Industry Foundation Classes (IFCs) properties edit have made a full set of BIM tools for archaeological projects available. Because of this, this platform alters conventional archaeology research and partnerships [
3,
5,
6]. Recently, different works have been focused on how artificial intelligence and specific algorithms can be extremely useful for BIM and HBIM purposes.
Early experimentation of LLMs on BIM workflows concerned the automatic classification of elements as well as supporting databases, semantic queries, and knowledge graphs. In this regard, Li Y. [
7] carried out interesting research for designing a BIM-based AI system to improve building engineering databases. The method enhances efficiency, shortens design cycles, and optimizes architectural design, showing a 30% higher integration efficiency than traditional methods.
The project carried out by Massafra A. [
8] investigates how to improve Building Information Modeling (BIM) accessibility in the Architecture, Engineering, Construction, and Operations (AECO) industry by utilising Large Language Models (LLMs). It entails building a BIM model, including it in a knowledge graph, and analysing it with LLMs; the outcomes are displayed in an intuitive interface.
Bienvenido-Huertas D. [
9] demonstrates how LLMs can be exploited for semantic classification in the HBIM pipeline. Furthermore, AI can be crucial in order to evaluate the degree of intervention with a sufficient degree of adjustment, a categorization model was first created. Then, by automating the decision-making process, this methodology shortens the time needed for evaluations, information management, and visualization [
9,
10].
Interesting analyses focused on the integration of AI in the BIM framework for mapping damages in buildings. In fact, the study proposed by Musella C. [
11] uses BIM methodology and AI to detect and digitalize damage in buildings, aiming to speed up seismic repair processes with an image-based recognition-BIM classification technique. Then, innovative research aimed to help the environment to deal with actual climate changes: Li J. [
12,
13] proposed a review of how BIM, GIS, and AI could help achieve Net-Zero Carbon Cities (NZCCs) and Sustainable Development Goals (SDGs). Advanced tools like city digital twins and GIS spatial analyses are underused. The study that he proposed emphasizes smart city initiatives and data-driven decisions for NZCCs, highlighting opportunities, barriers, and the need for better integration [
12,
13].
Furthermore, recent interesting applications are focused on the integration of LLMs inside the script pipeline of Visual Programming Languages (VPLs) such as Autodesk Dynamo [
14] and Grasshopper (the algorithm modeler for Rhinoceros) [
15,
16,
17]. Programming languages as well as tailor-made algorithms have been the focus of the study proposed by Darko A. [
18]: this research analyses AI in the AEC industry, examining different AI methods like genetic algorithms, neural networks, and machine learning. It highlights trends, research gaps, and future paths, serving as a valuable reference for industry professionals and policymakers.
The purpose of this work is to explore how LLMs can be applied in a parametric modeling project for open source HBIM purposes and understand how AI solutions are reliable for parametric modeling as well as how they perceive architectural queries and suggestions. Then, another purpose is to understand how LLMs transpose architectural requests to Python scripts and try to comprehend the fairness of the code.
This project was inspired by the interesting work carried out by Du C. [
19]; his research focuses on the
text-to-BIM pipeline, where the proposed workflow converts text instructions into 3D building models using LLMs. It includes a rule-based checker for improving model quality. An interactive prototype showcases the potential for conversational modeling (
Figure 1).
In this regard, exploiting FreeCAD open source software proved to be fundamental thanks to Python scrips integration. Widely used in computer science, LLMs such as Chat GPT or Copilot are able to generate and improve codes in different languages. In this way, generative AI solutions can directly communicate with the software for scripting and modeling parametric architectural elements; this process is referred to as a very small operative workflow because it is just text-to-BIM, where the user requests a specific modeling task to the AI agent that creates the parametric object via Python scripts, and then the resulting code, once imported into FreeCAD, generates the requested objects in the 3D space. Then, ad hoc parametric families have to be set. Being a Python-based modeler, FreeCAD communicates with AI through scripts in Python language and is a communicative bridge between the AI and the parametric software.
The scientific contribution of this work is based on the innovative integration of Large Language Models (LLMs) into Historic Building Information Modeling (HBIM) workflows, especially as parametric modeling is concerned. The automation of parametric modeling is driven by AI-generated Python scripts that may greatly reduce human error and increase efficiency while creating parametric models for HBIM and archaeology. This innovative method (text-to-BIM) relies on written requests to OpenAI agents and the resulting output employed in FreeCAD software. In this regard, this work demonstrates how FreeCAD, an open source program based on Python, may be exploited to perform AI-driven parametric modeling for HBIM.
2. Materials and Method
This work is based on the experimentation of generative AI for parametric modeling inside an open source HBIM framework. OpenAI [
20] is a cutting-edge artificial intelligence research organization dedicated to making sure AI advances humankind as a whole. OpenAI has consistently pushed the limits of what AI is capable of by creating a number of noteworthy AI models and applications. Chat GPT [
21] is one of their best-known models. In this regard, this Large Language Model is a flexible tool for a range of purposes, from brainstorming and creative writing to answering questions and offering recommendations, because it can produce text that appears human-like depending on the input it recieves. Chat GPT has undergone several iterations, all of which have improved in terms of comprehending context, producing logical answers, delivering precise information as well as coding in different languages (e.g., Python, Javascript, HTML, CSS and so on).
Chat GPT is included inside different AI companions such as Microsoft Copilot [
22]. This AI agent is based on GPT-4 Turbo and it offers an improved version of the free version of Chat GPT. For this reason, Copilot and this version of GPT have been tested and exploited for this project. For this work, FreeCAD software (version 0.21.1) [
23] was utilized as a parametric and HBIM (Historic Building Information Modeling) platform for modeling via Copilot scripts. Recently, a custom workbench on the GPT-4 agent has been integrated inside FreeCAD generating Python scripts. Users can input and generate codes for free, even if an OpenAI API (Application Programming Interface) key is required. For the method proposed here, an API key is not required because the text-to-BIM operations were performed by making Copilot and FreeCAD communicate separately.
This powerful tool, which has been employed numerous times for BIM purposes [
1,
3], is a comprehensive and customizable parametric modeler that includes various add-ons and plugins developed for information systems. For instance, libraries such as
ifcOpenShell and plugins like
DynamicData enhance the functionality of FreeCAD, making it a fully operational BIM platform [
1,
3]. The ifcOpenShell library facilitates seamless interaction with Industry Foundation Class (IFC) files, ensuring accurate classification and management of building components. Meanwhile, the DynamicData plugin allows for the flexible manipulation of data within the model, enabling users to define and modify parameters dynamically.
Moreover, FreeCAD’s open source nature allows users to tailor the software to their specific needs, making it a versatile tool for a wide range of applications, from architectural design to engineering simulations. The software’s robust parametric modeling capabilities ensure that changes to one part of the model automatically propagate throughout the entire design, maintaining consistency and accuracy.
This combination of customizable features and powerful plugins makes FreeCAD an invaluable asset in the field of HBIM, enabling the creation of detailed and accurate models of historic buildings. By leveraging the capabilities of LLMs and advanced modeling techniques, FreeCAD provides a solid foundation for efficient and precise BIM workflows.
Despite this being an HBIM project, it was not carried out via a traditional scan-to-BIM approach [
24,
25,
26] so it does not include a metric acquisition of the case study, point cloud management and segmentation, manual parametric modeling, or entity classification inside the BIM platform. As far as the built heritage is concerned, the scan-to-BIM approach is the essential methodology for achieving the needed metric data [
26,
27], but, by the usage of AI assistance, different scenarios will open [
28]; for example, within this work, we will see whether and how the text-to-BIM workflow could improve the traditional one via Python scripts.
3. Case Study and Workflow
3.1. Operative Workflow
The here-presented evaluation project focused on the parametric modeling of the Parthenon temple in Athens. As anticipated, this modeling was carried out through Python scripts generated by GPT-4 Turbo implemented inside Microsoft Copilot and imported into FreeCAD software. When a request was entered into the chat box, by using Chat GPT or Copilot, it analysed the query and, in a few seconds, gave the answer: it included a brief summary of what it was going to create, then the Python code, and finally the explanation of the written code. The generative AI created the architectural model through a script, that, once imported inside the FreeCAD environment via the Python console, is automatically converted into 3D parametric objects. In this way, in addition to the 3D space, the property tree on the left has also been updated with new objects. The operative workflow is resumed in
Figure 2.
3.2. Copilot Investigations and Training
As mentioned above, this test focuses on the parametric modeling of the Parthenon temple in Athens. The first phase involved a short training of Copilot regarding knowledge of the temple and FreeCAD. Regarding technical queries, questions have been made to understand general knowledge of the software and to realize whether it can handle parametric modeling via Python and FreeCAD. Copilot promptly answered
“Yes, I know about FreeCAD! It’s an open-source parametric 3D CAD (Computer-Aided Design) modeler that’s ideal for product design, mechanical engineering, and architecture. Here are some of the key features of FreeCAD […]” (
Figure 2). Then, a specific question was asked whether it was able to model parametrically through coding and he answered:
“Yes, I can help with that! Parametric modeling in FreeCAD using Python involves creating objects and defining their parameters in a way that allows for easy modification. Here’s a simple example to get you started […]” (
Figure 3). Other unregistered times, Copilot also specified that parametric modeling in FreeCAD is
“especially powerful when combined with Python scripting, as it enables you to auto-mate the creation and modification of complex models”.
As mentioned before, investigations and training on architectural knowledge of the temple were conducted. A general question was made to find out if it knew the architectural plan of the Parthenon temple and it replied:
“Sure! The image you’ve uploaded shows the architectural plan of the Parthenon, which is a classic example of ancient Greek architecture” (
Figure 3). Then, it started to describe the features and organization of the architectural plan:
“Peristyle.
The plan is rectangular and features a series of columns arranged in a continuous porch, known as a peristyle, surrounding the perimeter of the building. The outermost layer consists of a double row of columns, with more columns on the longer sides than the shorter sides. Cella (Naos). Inside the peristyle, there are two main sections. The central part is the cella (or naos), which is the inner chamber housing the statue of Athena. The cella is divided into two rooms: The larger room contains a rectangular arrangement of columns surrounding a central open space. The smaller room, called the opisthodomos, is located at the back of the temple and is also surrounded by columns. Pronaos. The pronaos is the front porch leading into the cella. It is an open area with columns that provide a grand entrance to the temple” (
Figure 4).
After, it was requested to specify all the architectural features of the religious temple and it texted and highlighted all architectural details: location and purpose; architectural style; dimension and layout; architectural features; material and construction; artistic elements (
Figure 3). Other unregistered actions regarded the digital drawing (by lines and points) of the architectural plan: the architectural plan of the temple was attached to the chat and Copilot was requested to assimilate and comprehend the element disposal. It delved into the Parthenon’s architectural design and drew a conceptual but detailed layout including the Peristyle (Colonnade), the Pronaos, Naos/Cella, and Opisthodomos. Furthermore, it included information regarding mathematical precision, symbolism, and cultural significance.
3.3. Text-to-BIM
After the knowledge-based investigation of Copilot started the parametric modeling phase based on Python scripts generated via text answers. This step, as a text-to-parametric modeling or text-to-BIM, relies on simple requests on modeling architectural elements of the temple, starting from the plan. DRAFT, SKETCHER, and PART workbenches have been exploited by AI for drawing and modeling inside FreeCAD.
The first modeling request was based on the general creation of parametric elements of the temple starting from the attached plan: Copilot generated a Python script where PART and DRAFT workbenches were imported for adding new objects. The result was cheap it included metric errors and architectural and volumetric issues: it modeled a rectangular base without the right dimensions, giving 16 columns (with the wrong height) on the Peristyle and an oversized Naos. The inner columns were not created (
Figure 5).
The second experimental step regarded, in addition to metric units and metric scale corrections, the creation of missing columns: 8 columns on the lesser side and 17 on the longest one. The diameter and height were correctly set. Despite these modifications, GPT-4 Turbo behind Copilot missed a column on the lesser side (
Figure 6).
The next step concerned the creation of Doric capitals for each column, composed of echinus and abacus: the AI generated a single object placed on top of the columns but having wrong widths, heights, and lengths (
Figure 7). For this reason, the next request regarded the subdivision of capital elements into abacus and echinus by setting precise measurements. After four attempts, Copilot succeeded in splitting parametric elements of capitals (
Figure 8).
The internal Naos was fixed as concerning length and width via SKETCHER and the PART workbench. Furthermore, two rectangular accesses were created on smaller sides of the Cella through cutting actions in the PART toolbox; then, these walls were retracted. Copilot succeeded after five attempts (
Figure 9). After this stage, the inner columns of the temple (placed in front of the small sides of the Naos) were created; Copilot just copied and pasted six Doric columns for each side starting from the peristyle (
Figure 10). The linear placement of columns was fixed three times before Copilot placed the elements in the correct position.
For the creation of the ceiling of the temple, Copilot was trained with adaptive instructions because it was not receptive as architectural requests are concerned: specific architectural requests (additions and modifications) were not understood due to gaps in architecture knowledge; in this regard, adaptive requests concerned into step-by-step instructions based on FreeCAD commands, tools and object geometries. It created solid extrusions obtaining three elements in terms of covering, architraves, and frieze. As the top of the roof is concerned, Copilot failed in multi-pitched modeling and it failed in the creation of the roof pediment; moreover, it created elements without the right measurements as well as placement. These errors and issues have been repeated 13 times (
Figure 11). For this reason, we decided to manually model the sloped roof of the temple by following the same level of detail of other parametric objects (average LOD 3). It was created through a composite system having different elements as shown in
Figure 12.
After this stage, the entire structure of the Parthenon temple has been modeled. It refers to the main architectural elements and volumes and does not include decorative elements (
Figure 13). Simplifications, depending on the low–medium level of details (LODs), have been performed for the representation of features. In fact, LODs (related to new constructions) and levels of geometric accuracy (for built heritage) were not the main purposes of this work.
3.4. IFC Classification
Furthermore, LLMs can also be exploited for performing other actions in a BIM pipeline; in addition to managing parametric elements (metric changes, duplications, and so on), it can be useful for setting specific properties such as compositions and materials, information of the site, and other tasks. It is able, always via texting requests, to create spreadsheets regarding particular elements; in fact, it invokes the proper workbench for creating the desired datasheet. For this project, Copilot was explored and tested as concerns the IFC classification of architectural elements. By requesting to classify specific parametric objects, it verifies, through FreeCAD possibilities, geometries and volumes for proceeding in this operation; for example, all columns elements of the temple were classified as
ifcColumns through the ARCH workbench invoked in Python scripts by AI. ARCH workbench, in FreeCAD version 0.21.1, is the toolbox designed for BIM modeling and classification [
1,
3]. It includes standard architectural classification and can contain customized parametric families. The specific request was as follows:
“starting from this code, classify all columns of the temple as architectural elements ifcColumn. Then, add an identification code as C01, C02 and the description Doric Column” (
Figure 14). At the same time, the entire structure of the Naos was classified as
ifcWall. Even here, Copilot created an identification code as well as a description of the Naos/Cella (
Figure 15).
4. Results and Discussion
In the modeling phase discussed above, many intermediate steps were not listed. These steps mainly involve the duplication of elements, ensuring accurate measurements, correct positioning of components, and the addition of new elements. Furthermore, some elements were modeled after multiple repetitions and thorough testing. The final product of the
text-to-BIM process and manual approach can be notice in
Figure 16.
In addition, there were difficulties in guaranteeing the stability of the models produced, integrating the models with pre-existing architectural blueprints, and preserving consistency in the modeling process. To obtain the required degree of accuracy and functionality, the process’s iterative nature required ongoing modifications and enhancements.
The modeling process also encountered numerous errors and issues. These primarily include errors in the assignment of Python variables, mistakes in adding and positioning new architectural elements, and difficulties in incorporating architectural suggestions and changes. Additionally, there were instances of typos in the syntax under specific conditions (e.g., if/else statements), metric and scaling issues, and errors in the measurement of architectural components and overall dimensions.
Notwithstanding these difficulties, the workflow showed how automation and AI-driven methods could increase the effectiveness and precision of architectural modeling. Many of the existing restrictions are expected to be solved as technology and methodology advance, resulting in modeling frameworks that are more resilient and dependable.
The workflow presented here, which is based on the text-to-BIM pipeline via Python scripts, possesses both advantages and critical issues. The application of artificial intelligence-based modeling hinges on rapid coding and parametric modeling through textual queries; these steps can be executed even without possessing any prior knowledge or awareness of the Python language and FreeCAD modeling.
However, the evaluation carried out in this context has shown that this type of modeling framework currently faces several challenges. Primarily, it has significant shortcomings in terms of architectural knowledge, necessitating the provision of adaptive instructions. Additionally, it demonstrates several metric errors in architectural modeling, along with mistakes in Python coding for FreeCAD scripting.
Despite the aforementioned problems, Copilot also offers some insightful clues. For instance, before proceeding to the IFC classification phase, it alerts us to the necessity of installing the ifcOpenShell [
29] library for FreeCAD to function correctly for IFC classification. Without this library, FreeCAD may not be able to classify IFC elements accurately. This crucial information ensures that the workflow progresses smoothly and helps to avert potential pitfalls during the classification process. IFC classification has been carried out for testing the reliability of elements classification through the usage and association of PART models (columns and walls), ARCH workbench, and ifcOpenShell library; in fact, Copilot has correctly associated the overall geometry of Doric columns and Naos to IFC elements in which ad hoc families (having specific properties) were created (
Figure 17).
The here-proposed text-to-BIM method, being a smart dialogue with an AI agent, can be applied to several situations for AECO and heritage assets. Parametric models can be easily created, via Python scripts, without using dedicated controls and options inside the BIM software; this possibility can be extremely useful also for software based on the Visual Programming Language (VPL) where the coding, scripts, and visual connections are fundamental for parametric and generative objects. Users can quickly write coding requests for creating parametric objects; then, scripts can be verified and modified depending on particular needs or technical issues.
However, the exact replicability of this project is strictly based on the step-by-step procedure affected by the level of learning of Copilot, including issues and errors in Python coding as well as architectural knowledge. Being a preliminary test, further evidence or testing is needed to confirm its broader reliability for archaeology, heritage assets, and AECO.
BIM and HBIM workflows proved to be complex to manage, especially for those who are recently approaching these topics. In this regard, different works and projects aim to automate and speed up the parametric and semantic processes behind BIM and HBIM [
11].
The here-presented project proposed an evaluation framework for LLM-based automatic modeling for BIM purposes. By automating parametric modeling, software issues and specific difficulties could be deleted to speed up the core of BIM and HBIM processes, leaving the semantic sphere and ontologies behind. However, as we have seen, several architectural knowledge gaps as well as coding errors could make the process unstable. Making metric errors and positional shifts renders the modeling process completely devoid of geometric and volumetric value, affecting the entire BIM/HBIM process.
Parametric errors and modeling issues can be handled. Being a Python code, it can be explored and modified depending on particular issues, allowing for a high degree of flexibility and customization. This characteristic makes open code an ideal choice for various applications in the field of parametric modeling, architecture, and beyond.
For this testing project, no code modifications have been made, as the primary purpose was to investigate how the artificial intelligence behind Copilot could model single architectural elements accurately and efficiently. By maintaining the original code, we can better understand the capabilities and limitations of the AI in its default state. Future projects may involve code adjustments to address specific challenges or to enhance the modeling process further, leveraging Python’s extensive libraries and frameworks to achieve more complex and refined results. In this regard, the obtained results should be compared with other outputs. Comparative analyses could be performed between GPT-4o, Turbo, and Pro scripts. Early tests on parametric modeling concerned data extraction and model accuracy as well as word manipulation and pattern recognition: GPT-Turbo, implemented inside Copilot, managed to work better than 4o. In future steps, handling different parametric LODs on architectural elements could provide interesting results.
5. Conclusions
This work aimed to demonstrate the potential of LLM-based agents for parametric modeling via Python scripts as well as highlights evident limitations and critical issues. Since the early introduction of AI agents in engineering, inside workflows, and operative tasks, the human impact has been reduced and simplified [
30,
31]. In the AECO industry, it could be crucial for changing construction and maintenance timing [
32].
The study helps to understand how to preserve and manage historic structures by enabling comprehensive automated BIM models, creating opportunities for more effective workflows for heritage buildings. Furthermore, it explores the role of AI in historic architecture and archaeological modeling, offering new possibilities for innovation in cultural heritage management.
This flexibility could also occur for the BIM pipeline, from modeling to classification, from the inclusion of semantic data to the queries phase. For example, by texting “generate a cross-vault in FreeCAD by using Python” the AI generates a code that should be related to the creation of a parametric vault. After having tried a few times, it computes an intersection of two barrel vaults, achieving an acceptable result. Investigations, training, and clear (and adaptive) suggestions should be considered before texting. However, the complete automation of parametric modeling by AI agents is extremely dangerous; automation does not mean intelligence, and manual control and precise verification of creations must be carried out. Copilot experienced difficulties regarding the roof modeling as well as in receiving particular architectural instructions. In fact, the sloped roof was manually modeled.
The integration of scripts and open codes inside a BIM platform could guarantee constant control of specific tasks and features; parametric modeling occurred via text-to-BIM scripting and is editable depending on integration or issues, and ad hoc functionalities (addons, workbenches, and macros) can be constantly implemented by improving the code. These possibilities could open wider scenarios on project interoperability via open source platforms; the reuse and replicability of specific tasks and features via findable open codes and open solutions could be crucial for accessibility.
For this reason, open source BIM projects should be oriented towards the interoperability of data and also of operative protocols. To characterize the degree of interoperability that a single user can have with numerical data, the FAIR principles were introduced in 2016 [
33]. Four standards were established. Together, they make up the acronym FAIR:
Findable—the ability to locate info that already exists;
Reusable—the ability to utilize the data;
Interoperable—the ability to comprehend the data that has been obtained;
Accessible— the ability to obtain data. Nowadays, interoperable OpenBIM projects should comply with FAIR principles to guarantee all standards to BIM users, especially accessibility and interoperability. By using open source solutions and open codes, reuse and availability can also be ensured: the general framework and operative steps (e.g., modeling and semantic data inclusion) might be accessible to users for transparency and replicability.
For example, the project carried out by Beaufils M. [
34] enhances the BIM pipeline for infrastructure, focusing on geotechnics: here, data models and vocabularies support the openBIM and openGIS standards, and this ensures data compliance with FAIR principles for sustainable management of underground infrastructure.
In conclusion, this work involves possible future developments. It is related to the experimentation of GPT-4 Pro and then compares previous outputs. Then, modeling in different LODs could be challenging considering actual difficulties and critical issues on architectural comprehension. At the same time, it could be very fruitful and interesting to perform metric comparisons between the parametric output generated by the AI companion and the reality (LiDAR or photogrammetric data). In this case, metric deviations and distance maps could serve the purpose of understanding the level of accuracy of text-to-BIM modeling. Further research can also explore optimizing the algorithm to handle various architectural styles and complexities, enhancing its adaptability and precision.