THE INTEGRATION OF A SCAN-TO-HBIM PROCESS IN BIM APPLICATION: THE DEVELOPMENT OF AN ADD-IN TO GUIDE USERS IN AUTODESK REVIT

: In recent years, the generative process of building information modeling (BIM) digital models oriented to the digitisation of heritage buildings has been supported by the development of new modeling tools, able to integrate the point cloud data produced by laser scanning and digital photogrammetry in major modeling software applications such as Autodesk Revit and Graphisoft Archicad. Architectural and structural elements of churches, castles, and historical monuments such as complex vaults, arches, decorations and ornaments, irregular walls with a variable section and wall stratigraphy require higher levels of detail (LOD) and information (LOI) than new buildings. Consequently, the structure of a BIM model oriented to represent heritage buildings (HBIM) required the definition of a new digital process capable of converting the traditional techniques to the generation of 'unique' digital models able to connect different type of information. Consequently, the generation of 'new' 3D objects able to follow the constructive logic of the detected artefact has required the establishment of new grades of generation (GOG) and accuracy (GOA) to reduce the time and cost of the scan-to-BIM process. The main challenge of this research was the integration of these new modeling requirements in BIM software through the development of an add-in for one of the most used BIM software (Autodesk Revit). Through the generation of the complex vaulted system of the Basilica of Collemaggio (L’Aquila, Italy) and one of the most famous monuments of northern Italy (Arch of Peace in Milan, Italy), the following research shows how it was possible to support users in the HBIM generation, reducing the modeling impact of complex shapes from point cloud data and increasing information sharing for different BIM-based analysis, disciplines and users.


INTRODUCTION
Digital era is revolutionising our work processes through the technological development of new tools and methods.In the 90s, Architecture, Engineering and Construction (AEC) Industry was characterised by one of the main digital reforms: the transition from hand drawing to technical drawing with the use of computer software (CAD), improving decision-making processes for the design of new buildings and the restoration of existing/heritage buildings.The 2000s, instead, were characterised by the transition from 2D CAD representation to the creation of Building Information Modeling models able to digital represent heritage buildings in 3D space and automatically create digital repositories and databases (Dore & Murphy 2017).As we well know, thanks to the BIM logic, it has been possible to move from the concept of static representation of the building (2D CAD drawings) to the concept of information process (digital models that can support the long life cycle of building LLCB) (Brumana et al. 2018).Thanks to the bidirectional logic (model -information) it is possible to increase the communication of the different types of information and parameters connected to each 3D object included in the BIM libraries of the parametric modeling software, such as wall stratigraphy, material, physical and mechanical characteristics, and historical phases.From an operative point of view, this bidirectional function allows us to switch from a simple geometric model to a model capable of communicating and storing a larga amount of data compared to 2D CAD drawings (Banfi 2016).Furthermore, innovation in the field of digital cultural heritage (DHC) has been supported by the development of modern 3D survey techniques capable of intercepting the morphological characteristics of heritage buildings with high levels of precision, revealing the uniqueness that has distinguished them over the centuries (Ioannides & Quak 2014) On the other hand, the intricate reality of heritage buildings and the absence of 3D objects corresponding to historical elements in the BIM libraries require the creation of BIM models through a limited number of modeling tools, which require long modeling phases during the generative process.In particular, the absence of Non Uniform Rational Basis-Splines (NURBS) functions able to interpolate the point clouds (GOG 10), and the absence of instruments able to automatically extract geometric primitives from slices (GOG 9) in BIM application has been interpreted as the most critical barrier for HBIM generation (Banfi 2017).However, in light of this, the availability of shared languages, known as Application Programming Interface (API), published online in cloud developer platforms (Autodesk Forge and Revit API), has allowed this research to undertake the design of a Revit add-in with the main objective of transferring generative modeling and GOGs within the BIM software (Fig. 1).This study summarises years of research in the field of advanced modeling by placing the new paradigm of the 'quality' of the model in the centre of the generative process.A novel scan-to-BIM process, in addition to the level of detail (LOD) and information (LOI), also should indicate the 'how' an HBIM model should be realised (GOG -modeling requirements) and with what grade of accuracy (GOA -standard deviation between model and point cloud) should be achieved for each single 3D object.The establishment of a generative process based on new GOGs and GOAs for scan-to-BIM models has led to the creation of a 'facility' tool able to support and guide BIM users during the generative process.Consequently, the add-in represents the maximum possible result in terms of development oriented to integrate the proposed scan-to-BIM process in Autodesk Revit.

RELATED WORKS AND RESEARCH OBJECTIVES
In recent years, the growing need to improve the management and conservation of the built heritage has led to the development of interesting studies in the field of HBIM (Kuo et al. 2018) (Fai et al. 2014) (Tucci & Bonora 2011).Innovative methods in the field of digitisation of the built heritage have underlined the need to orientate BIM applications also for heritage artefacts (Stanga et al. 2017).Starting from the assumption that each building has its own morphological and typological peculiarities, the use of reality capture data (point cloud data) has further highlighted the inadequacy of BIM libraries oriented solely to the creation of simplified models.Vaults, arches, capitals, and irregular walls represent the uniqueness of the built heritage and cannot be represented by simplified forms.More advanced studies have also shown how different LOD and accuracy can coexist in a single model in order to meet specific project requirements.HBIM model can focus on the different types of analysis, reducing and enhancing the LOD of each building component according to the projects needs (Brumana et al. 2018).It is, therefore, logical to understand how modeling is the key to increase or decrease the grade of accuracy (GOA) of the models.For this reason, the following study is based on the application of new grades of generation (GOG) and accuracy with the aim of improving the automation level of the scan-to-BIM process for unique heritage buildings.Therefore, when we talk about BIM, we are talking about a digital model composed of intelligent relations between object and parameters; every single element represents a digital repository for different types of information.Starting from this assumption, for the built heritage it is obvious to create objects able to embed the hidden value of the building coming from historical research, material analysis, inspections, historical reports and so on.All these types of data are considered secondary data sources and must be taken into consideration from the early stages of the generative process together with the point clouds coming from the survey operations (primary data sources).In recent years, HBIM has become a fundamental resource for managing different processes such as the restoration and preservation of heritage buildings, extraction of accurate 2D drawings, conservation plan, sonstruction site information Modelling (CoSIM), finite element analysis (FEA), structural monitoring, virtual and augmented reality (Volk et al. 2014).In particular, disciplinary sectors such as geomatics and restoration have found in HBIM a tool capable of connecting fields such as surveying, geographic information systems (GIS), cartography, restoration and preservation of heritage buildings in a digital environment.A user-friendly modeling process able to connect the different type of information to 'smart' models represents a key element for the re-engineering of different fields such as restoration, preservation and facility management of heritage buildings.Therefore, technological development should assume homogeneity of language in procedures pointed to improve the osmosis between different modeling requirements and the new paradigm of the complexity of built heritage.This study overcomes the main modeling barriers in the HBIM field thanks to the development of new grades of generation (GOGs) and accuracy (GOA).The enrichment of 3D holistic 'informative' models with metadata and semantics in cultural heritage is transmitted within the process thanks to the definition of new levels of interoperability (definition of new exchange format's schemas for open source process) and thanks to the development of an add-in (new developed internal functions) to support BIM users in one of the most used application worldwide.Five years ago, for this holistic capacity, the following research undertook the in-depth study of the main advanced modeling techniques with the aim of to:  improve the generation of complex buildings by novel scan-to-BIM novel modeling requirements  reduce the generative time and cost of HBIM (modeling phase) through the development of an addin, simplifying as much as possible the generative process within Autodesk Revit  improve the information mapping and the information sharing of the different type of information related to the historical artefacts,  improve the 3D mapping of HBIM models with accurate orthophotos for HBIM models and VR projects,  improve the level of interoperability of digital models for different types of uses, disciplines and BIM-based analysis.

Grades of generation (GOG) for heritage buildings
This study made possible to lay the scientific and operational bases for the definition of novel modeling requirements capable of collecting different data sources such as 3D data capture data and 2D CAD drawings and convert them into an accurate scanto-BIM model.Thank the establishment of novel grades of generation and accuracy in Banfi, F. (2017).BIM orientation: grades of generation and information for the different type of analysis and management process has been possible to integrate user-friendly modeling practices in BIM software.
As mentioned in the previous paragraph, the modeling toolset in Autodesk Revit is characterised by a limited number of functions able to create the most commonly used BIM objects such as the doors, windows, simple walls, ceiling, and roofs.These functions represent the first eight grade of generations and are not enabled to create complex BIM objects from a set of points.
As we well know, reverse engineering functions are used to other types of sectors and purposes such as generative design, prototyping, mechanical engineering and software engineering.
There are so many different modeling solutions in these specific areas, and the source code of most of them is hidden from our side.
On the other hand, none of them is oriented to create heritage buildings from point cloud data without to use mesh modeling.
In reverse engineering, the traditional production process of an object begins with the manual creation of a 3D object made by a designer.The prototype is modeled in such a way as to give it specific functional and aesthetic characteristics.In the case of surfaces with free/complex geometry, changes to the original parts of the project are challenging to make, and often they cannot even be analysed or described concerning the original design.
Therefore, the usefulness of novel modeling requirements aimed at the creation, automatically and in a short time, of a 3D objects able to corresponds to the detected reality is fundamental also for heritage buildings.
The task of the scan-to-BIM process is to satisfy the same need for heritage buildings and its complex architectural and structural elements.
In recent years, starting from a point cloud, through two novel grades of generations (GOG 9-10), has been possible to transform points in 'informative' models.
Figure 2 shows the ten GOGs and the related modeling requirements to create HBIM objects.For the first eight GOGs, the research of the last few years did not implement functions or commands (modeling functions already integrated into Autodesk Revit) while for the last two GOGs introduced two new modeling requirements to create BIM objects from point cloud data (functions not integrated into Autodesk Revit).
In particular, GOG 9 is based on the 1.Editing and filtering of measurement data.2. Segmentation and creation of mathematical models (3D edge and inner curves) 3. The digitisation of the NURBS surface 4. Creation of BIM models from NURBS surface.
GOG 10 instead, improve the process avoiding step 2: 1. Editing and filtering of measurement data.

NURBS interpolation between a 3D edge and points
for the digitisation of the surface.3. Creation of BIM models from NURBS surface.
The primary goals of the development of GOG 9 and 10 were: to reduce the generative time and cost of HBIM (modeling phase), simplifying as much as possible the process within Autodesk Revit which, to this days, requires multiple command sequences and;  to improve the generative process of heritage buildings with a high grade of accuracy (GOA).
Figure 2. The novel scan-to-BIM modeling requirements in Banfi, F. (2017).BIM orientation: grades of generation and information for the different type of analysis and management process.

The grade of accuracy (GOA) and the automatic verification system (AVS) for scan-to-BIM models
The absence of advanced tools in the BIM software and the presence of modeling tools such as the extrusion (GOG 1), the edit profile (GOG 2), the sweep and swept blend,… as illustrated in the previous paragraph, do not allow the generation of complex elements characterised by a high number of irregular architectural components.The test results laid the foundations for the establishment of parameters and modeling procedures able to fill this generative gap.The tests highlighted the possibility to create BIM objects without to directly model it Autodesk Revit, maintaining a high level of interoperability with every type of modeling software.
As a consequence, before carrying out the transformation from NURBS surface to BIM object ( last step of GOG 9 and 10), the analysis of the surfaces has been analysed in order to improve a system able to certify the quality of the produced model.
For this reason, thanks to the analysis of the surface's curvature, an automatic verification system (AVS) has been calculated the grade of accuracy (GOA) and accurately provide the value of the standard deviation between NURBS surface and point cloud.The analysis of the Gaussian curvature can be easily activated in the 3D modeling software, showing where there may be any anomalies in the curvature of a surface.
Figure 3 shows the tests conducted on the Basilica Collemaggio's umbrella vault after the earthquake in 2009 (L'Aquila, Italy).The geometric discontinuities are highlighted by the analysis of the mean curvature, min and max radius.
Thanks to this type of display, in addition to intercepting the values of the superficial deformations of the vault, it is possible to evaluate the NURBS surface produced.The figure shows how, thanks to the application of GOG 9 and 10, it is possible to realise accurate models without losing geometrical information during the generation process.On the other hand, the analysis of the curvature was not useful for defining a numerical parameter able to compute the real quality and accuracy of the model created by point cloud.The study has deepened and tested further methods of analysis with the aim of proposing an automatic verification system (AVS) able to provide reliable numerical values.'Point set deviation' function has been identified as the most suitable type of analysis of the proposed AVS in order to evaluate the GOA of the model between point cloud and NURBS surfaces (Fig. 4).
Figure 4 The AVS of the umbrella vault provided for a GOA of 5/10 mm.
A quantitative value is provided to quantify the quality of the models produced directly from the point cloud.This analysis provides numerical values that represent the standard deviation between point clouds and the whole model.This solution is not only an overall indication, but it can be used to improve model quality over time and, thanks to its direct computation, to report the reliability of the model for further in-depth analysis.
The reproducibility and repeatability of the analytical method (AVS) can be easily activated in any application.Mc Neel Rhinoceros provides a user-friendly solution: select the cleaned point cloud and the produced model to obtain the GOA's parameters.

HBIM generation based on multiples GOGs and GOAs
Over the years, the generation of HBIM models has underlined the need to create models capable of orienting themselves to specific project needs.Consequently, the generation of a model composed of an infinity of sub-elements requires different levels of detail (LODs), high grade of accuracy (GOA), and exchange formats.For this reason, GOGs are decisive factors for HBIM models, optimising the generative process according to the project needs.The Arch of Peace in Milan was a useful case study to optimise the application of the ten GOGs.Based on different data sources it was possible to obtain HBIM objects with different GOAs (Fig. 6).The generation of the HBIM model has provided for the following operational steps:

3D mapping of HBIM models
Thanks to different data sources, the digital archive of the BIM model of the Arch of Peace, was composed of a large number of data such as historical reports, descriptive texts of its constructive phases, point clouds, 2D outputs from digital photogrammetry such as photo plans and orthophotos.These two types of 2D representation (photo plans and orthophotos) represent the main bases for drafting 2D CAD vector drawings.This research instead proposes the reverse process: the automatic creation of 2D/3D representations from an accurate HBIM model.Thanks to the graphic post-production of photo plans and orthophotos, it has been possible to create the image file formats suitable for correct 3D mapping.For this specific phase, the operating key was the use of GOG 9 and GOG 10.Thanks to the generation of the accurate NURBS models, it was possible to create complex elements capable of faithfully representing point cloud data.Before mapping, the requirements for VR applications were also considered: 3D modeling software and game engines require the definition of the normal vectors to make visible every single 3D object mapped in the digital environment.Figure 7 shows the 3D mapping process applied to the HBIM and the need to properly orient the surface normal vectors for the most commonly used VR application.As we well know, the game engines require the use of mesh models.The import phase of accurate HBIM models, for the most of times, require long procedures of surface adjustment.Thanks to the automatic conversion of NURBS in the right amount of polygons, it has been possible to minimise the adaptation phase of the model.The main objective of the project was to provide an interactive model for the different types of users and devices such as Oculus Rift, tablets, mobile phones and PCs.
Figure 7.An accurate HBIM model and a proper 3D mapping enabled to achieve the different types of BIM-based analysis, uses, and modern devices, supporting the reading of the model and its mapped information.

The add-in use in the HBIM generation: a semi guided process for BIM users
The generation of smart models and digital archives able to accompany the management of architectural assets through different operational phases becomes an irremissible added value for the management of long life cycle of building (LLCB).Paragraph 3.4 has shown how the integration of generative modeling based on NURBS algorithms can support the generation of complex elements and follow the constructive logic of the building starting from the automatic extraction of geometric primitives (GOG 9) or by the NURBS interpolation (GOG 10), filling the modeling gaps present in the BIM software currently on the market.Moreover, thanks to GOG 9 and 10, it has been possible to create models with a grade of accuracy (GOA) of about 1 mm, improving the level of detail (LOD) of HBIM models exponentially.
On the other hand, a proper scan-to-BIM process requires the use of multiple modeling software applications such as Agisoft Photoscan, Autodesk Recap, Autocad, Revit and Mc Neel Rhinoceros.The know-how of this research and the use of APIs allowed the development of an add-in for Autodesk Revit composed of four sections that group and improve the Scan-to-BIM process through the hierarchy of (i) internal Revit functions, (ii) novel functions implemented by the Revit APIs and (iii) combined development of multiple Revit tools.The availability of shared languages known as Application Programming Interface (API) published online in cloud developer platforms (Autodesk Forge and Revit API), enabled this research to undertake the design of a Revit add-in with the primary objective of transferring the GOGs within the most commonly used BIM software: Autodesk Revit.The main goal was to reduce the generative time and cost of HBIM (modeling phase), simplifying as much as possible the process within Autodesk Revit which requires multiple command sequences and modeling requirements.
In order to integrate the GOGs in Autodesk Revit, it has been decided to gradually supplement the HBIM modeling requirements by a more robust system linked to four main steps (Fig. 9).
The four objectives for each oriented sections were: Application Programming Interface databases made it possible to identify the procedures available to the programmer, grouped to form a set of specific tools for the accomplishment of a specific task within Autodesk Revit.
Thanks to My First Plug-in has been possible to have a selfpaced tutorial guide for a smooth introduction to the programming world.This first step is a one-stop shop learning path for users who know Revit but are new to programming and are thinking about taking the plunge.Within this framework, it has been implemented an add-in aimed to lower cost and based on an innovative development workflow.An accurate study of the APIs was necessary in order to have an efficient development approach based on a great number of tests.The flexibility of the development language has allowed trying a long series of codes.The dimming of clicks allowed the consequent reduction of the times for every single function, benefiting the whole HBIM process.
In particular, thanks to the IT support, it has been possible to write the code in order to transfer the know-how of this research in the Revit add-in, bridging the gap of BIM's rigid logic with a real product for each type of user. Figure 1 shown the development process applied to the creation of add-in.Internal Revit functions: Autodesk Revit is known for the difficulty of activating modeling tools and functions quickly.The first reason is the lack of a user-friendly interface for advanced functions.Thanks to the complete knowledge of the functions integrated into the software it was possible to define a hierarchy oriented to Scan-to-BIM processes.Internal functions were recalled and hierarchized to improve the BIM generation.
Functions implemented by the Revit APIs: after the download of the various APIs library (in technical jargon the Revit API provided by Autodesk), it is possible to create a project in Visual Studio.This project needs the use of objects, properties and related methods which allowed to implement some useful commands.
Combined development of multiple Revit tools: the modeling in Revit is characterised by a series of procedures indispensable for the setting and management of the generative process.These procedures, for most of the time, require the activation of useful support toolsets such as the section box, the setting of the reference plane, the setting of the successive levels, the display modes and so on.Thanks to the development it was possible to combine the activation of several instruments through a single function.The main benefit was the reduction of project setup times and a more simplified mode of activation of advanced tools such as automatic database generation, schedules and material sheets.
In particular, Scan Management provided to facilitate the import of point clouds and to support the general setting of scan-to-BIM projects.A few years ago, Autodesk Revit introduced the possibility of viewing point clouds in 3D digital space.Once the point clouds have been imported, it is not possible to apply GOG 9 and GOG 10 directly.As stressed in previous paragraphs, the lack of NURBS functions and the automatic extraction of geometric primitives do not allow the automatic generation of the complex model from 3D scans.
The first section enabled new modeling tools to support Revit user in the correct setting of scan-to-BIM project requirements.
Figure 8 Modeling (GOGs) is the second add-in's section.This section integrates the GOGs, (from 1 to 10) in the software structure through the direct activation of the main BIM objects such as wall, roof, floor and ceiling.Their great use in scan-to-BIM projects dictated the choice to include these types of objects.
The other categories of objects such as a door, window, stairs and supplies have not been inserted because they do not need a scan-to-BIM process.The functions associated with them can be retrieved from the main interface of the software and are easily linked to the object's tools developed in the add-in.
In this section, 'wall by NURBS', 'roof by NURBS', 'floor by NURBS' activate the automatic function that allows the automatic creation of BIM objects from NURBS surface.The correct import of the NURBS surface into Autodesk Revit is described in the protocol and allows avoiding long internal modeling phases within Revit.Once the BIM object is automatically created, it is possible to use all the functions associated with it and expand the information mapping as needed.
Figure 09.Modeling (GOGs) section supports users in the generative process of scan-to-BIM objects through implemented functions and BIM protocols.
Database Generation is the third add'in the section.The main features included in this section are the automatic generation of databases and computing able to extract the numeric value such as volume, area, physical material information and descriptive information.This section allows different editing parameters from every single element created, passing from a BIM model to a personalised information model.The commands included in the third section led the automatic creation of the schedules of the building components, to direct data to different disciplines and to improve the visibility of costs and quantities automatically extracted once the model has been created.Open schedule creation is a command implemented in the third family to allow the user to define his information system.Once the model is created, the command enables the user to customise the BIM database.The user can extract the information for any object.
Figure 10.The third section allows users (expert and nonexperts) to extract information from the HBIM model.
Interoperability Levels is the fourth section.Thanks to the main exchange formats, GOGs and the mapped information are recognised and transferred according to the BIM-based analysis requirements.The types of exchange formats are supported by BIM protocols able to guide users to the correct export of the model, the two-dimensional drawings, the databases, internally generated schedules and sheets.Finally, this section also provides the possibility to share internal data and interact with external sources, databases and BIM cloud platforms maintaining a bi-directional relationship between object and information (Fig. 11).The ability to develop some commands has been fully exploited, while where the APIs and source data were not shared by Autodesk Revit the development had to stop.This gap has been filled by the inclusion of BIM protocols able to accompany the user step by step in all four families of the add-in with the final objective of reducing the time and costs of the generative process.

RESULT AND CONCLUSION
The potential of 3D survey techniques opens the door to various forms of digital modeling and information sharing, extending the fields of geomatics and restorations to the digital cultural heritage (DCH) domain.As shown in this research, from a semantic point of view, the recognition of the cultural values of an object depended on its capacity to arouse certain new type of parameters (not just the default parameters in BIM application) that led the society and experts in question to consider it as heritage and therefore, redefining heritage on the basis of its physical and morphological aspect.In this specific context, the importance and the centrality of the user and his knowledge of digital modeling are the primary sources for the correct management of the process.It is, therefore, necessary to unify efforts, define general rules that allow us to understand the wealth of tangible and non tangible built heritage values.For this reason, thanks to new modeling requirements and the developed add-in for Autodesk Revit (tech solution), this study has made it possible to reduce costs and times of modeling (cost-effectiveness), favouring the information-sharing (coworking) and the use of models in the different types of BIMbased analysis (holistic impact) and maintaining high level of interoperability among different types of applications (both open-source or proprietary solutions).The research case study has brought outstanding results in different fields of application and analysis, transforming the model from a three-dimensional representation to a management process of the built heritage.

Figure 3 .
Figure 3.The generative process of the umbrella vault.The post-processing is oriented to give (i) the best version of 3D (cleaned) scan to identify the edges of the main structures easily; (ii) the automatic extraction of geometric primitives allowed (iii) the creation of ultra-detailed NURBS surfaces by GOG 9 and 10, (iv) the Gaussian curvature allow the identification of structural failure and superficial anomalies automatically.


Figure 6.The generative process of the HBIM of the Arch of Peace in Milan.The ten GOGs have been applied to HBIM model to achieve the best level of detail (LOD), information mapping and information sharing of the historical monument.


Scan management: to facilitate the import of the 3D scan and to support the setting of Revit project for Scan-to-BIM process;  Modeling (GOGs): to integrate GOGs (9 & 10) in Revit architecture and to guide users in the creation of complex walls and historical elements with generative modeling;  Database generation (GOIs): to automate database generation and to enable the addition of new custom parameters;  Interoperability levels: to define novel exchange formats and to transfer HBIM model to different BIM-based analysis.

Figure 11 .
Figure 11.The fourth section of the developed add-in allows transferring the HBIM model in BIM cloud platform, VR software application, finite element analysis software.
The add-in structure is mainly composed of four oriented families able to interact with each other.Each section has been developed with Visual Studio Families.