Skip to main content
                     
As-Built As-Built - Revit As-Built - AutoCAD VirtuSurv - VirtuSurv 2018 As-Built - Modeler VirtuSurv - VirtuSurv 2019          
BuildIT BuildIT - Projector BuildIT - Construction BuildIT - Metrology              
CAM2 CAM2 - SmartInspect CAM2 - 2023 CAM2 - 2018 CAM2 - Measure 10 CAM2 - Measure Q CAM2 - Measure X CAM2 - Measure 3/4 CAM2 - AnthroCAM CAM2 - 2019 CAM2 - 2020
CAM2 CAM2 - 2021                  
Cobalt 3D Imager 3D Imager - Cobalt                  
Cobalt Design Cobalt Design - M Cobalt Design - S Cobalt Design - Dual              
Computers Computers - All Computers                  
FARO Aras 360 & CAD Zone FARO CAD Zone - Fire & Insurance FARO CAD Zone - Crime & Crash FARO CAD Zone - CZ Point Cloud FARO CAD Zone - First Look Pro FARO 360 - Reality FARO 360 - HD FARO 360 - Blitz FARO 360 - Genius    
FARO Connect FARO Connect - Connect                  
FARO Zone present4D - present4D                  
FARO Zone 2D FARO Zone 2D - 2018 FARO Zone 2D - 2019 FARO Zone 2D - 2020 FARO Zone 2D - 2021 FARO Zone 2D - 2022 FARO Zone 2D - 2023        
FARO Zone 3D FARO Zone 3D - 2018 FARO Zone 3D - 2019 FARO Zone 3D - 2020 FARO Zone 3D - 2021 FARO Zone 3D - 2022 FARO Zone 3D - 2023 FARO Zone 3D - 2024      
FARO Zone 3D Advanced FARO Zone 3D Advanced - 2018 FARO Zone 3D Advanced - 2019 FARO Zone 3D Advanced - 2020 FARO Zone 3D Advanced - 2021 FARO Zone 3D Advanced - 2022          
FaroArm/ScanArm FaroArm/ScanArm - Quantum S FaroArm/ScanArm - Quantum M FaroArm/ScanArm - Quantum E FaroArm/ScanArm - Edge FaroArm/ScanArm - Fusion FaroArm/ScanArm - Prime FaroArm/ScanArm - Platinum FaroArm/ScanArm - Legacy Quantum FaroArm/ScanArm - Titanium FaroArm/ScanArm - Advantage
FaroArm/ScanArm FaroArm/ScanArm - Digital Template FaroArm/ScanArm - Gage FaroArm/ScanArm - Quantum S Max FaroArm/ScanArm - Quantum M Max FaroArm/ScanArm - Quantum E Max FaroArm/ScanArm - Gage Max        
GeoSLAM Software GeoSLAM Software - Connect GeoSLAM Software - Draw GeoSLAM Software - Hub GeoSLAM Software - Volumes            
GeoSLAM ZEB GeoSLAM ZEB - Horizon GeoSLAM ZEB - Horizon RT GeoSLAM ZEB - Revo GeoSLAM ZEB - Revo RT GeoSLAM ZEB - Go          
Hand Held Scanner 2D Hand Held Scanner - ScanPlan 3D Hand Held Scanner - Freestyle3D 3D Hand Held Scanner - Freestyle3D X 3D Hand Held Scanner - Freestyle3D Objects 3D Hand Held Scanner - Freestyle 2          
Language Quality HT MT AT NT INT - Internal Sales - Internal Resources Sales - Order and Quote Sales - Product Info Sales - Sales Readiness Sales - Training
Language Quality Sales - Product Launch Sales - Promotions CS - Quote to Invoice CS - Phone System CS - New Hire Training CS - General CS - Product Info CS - Licensing CS - Procedures General CS - Procedures Salesforce
Language Quality CS - Procedures Loaner CS - Procedures SAP                
Languages Language - English Language - Japanese Language - German Language - Chinese Language - Spanish Language - Italian Language - Portuguese Language - French Language - Korean  
Laser Projector RayTracer - RayTracer Laser Projector - Tracer M Laser Projector - Tracer SI              
Laser Radar Imaging Laser Radar - VectorRI                  
Laser Scanner 3D Laser Scanner - Focus S 3D Laser Scanner - Focus M 3D Laser Scanner - Focus3D 3D Laser Scanner - Focus3D X 3D Laser Scanner - Focus3D X HDR 3D Laser Scanner - Focus3D S 3D Laser Scanner - Photon 3D Laser Scanner - Focus S Plus 3D Laser Scanner - Swift 3D Laser Scanner - Focus Premium
Laser Scanner 3D Laser Scanner - Focus Core                  
Laser Tracker Laser Tracker - Vantage Laser Tracker - ION Laser Tracker - Vantage S Laser Tracker - Si Laser Tracker - X Laser Tracker - Xi Laser Tracker - Vantage E Laser Tracker - Vantage S6 Laser Tracker - Vantage E6  
Legacy Gage Legacy Gage - Bluetooth Legacy Gage - Plus Legacy Gage - Standard Legacy Gage - Power            
Legacy Software Legacy Software - CAM2 Gage Legacy Software - Gage Software Legacy Software - Insight              
Mobile Scanner Mobile Scanner - Orbis                  
PointSense PointSense - Basic PointSense - Pro PointSense - Building PointSense - Plant PointSense - Heritage PointSense - Revit CAD Plugin - TachyCAD Building CAD Plugin - TachyCAD Archeology CAD Plugin - TachyCAD Interior CAD Plugin - PhoToPlan Basic
PointSense CAD Plugin - PhoToPlan CAD Plugin - PhoToPlan Pro CAD Plugin - PhoToPlan Ultimate CAD Plugin - DisToPlan CAD Plugin - MonuMap CAD Plugin - hylasFM CAD Plugin - VirtuSurv      
RevEng RevEng - RevEng                  
ScanArm ScanArm - Design ScanArm 2.0 ScanArm - Design ScanArm ScanArm - Forensic ScanArm ScanArm - Design ScanArm 2.5C            
SCENE SCENE - Capture and Process SCENE - WebShare Server and 2Go SCENE - WebShare 2Go App SCENE - 2018 SCENE - 7.x SCENE - 6.x SCENE - 5.x SCENE - 4.x SCENE - LT SCENE - 2019
SCENE SCENE - 2go App SCENE - 2020 SCENE - 2021 SCENE - 2022 SCENE - 2023          
Serial FaroArm Serial FaroArm - Silver Serial FaroArm - Gold Serial FaroArm - Bronze              
Sphere FARO Sphere - Sphere                  
Visual Inspect Visual Inspect - App Visual Inspect - CAD Translator                
WebShare WebShare - Enterprise WebShare - WebShare Cloud                

BuildIT

Metrology

FARO® Knowledge Base

Reading and Writing to Excel Using Python in an Automated BuildIT Process

BuildIT-bty.png

Overview

One of the key features of BuildIT is the generation of extensive reports, including several layouts and formats. However, in cases when the user already has an Excel report template and needs to keep its same report layout, in addition to using values computed through the Excel spreadsheet as inputs for the automated process, it is possible to leverage the Python interpreter that is available through the automated processes to perform those tasks.

This article provides an overview of how to achieve this through a simple process example. This example uses the win32com module, which drives Excel through its COM interface.

Other specialized Python modules also exist for writing and reading Excel spreadsheet, such as pyexcel and openpyxl. However, for our purpose in this example, win32com is sufficient, and it is also bundled with the BuildIT Python interpreter.

Example Workflow

  • Populate some values in the spreadsheet (cells in light green), based on the BuildIT model's content
    • In this example, we'll transfer the feature tolerances actual values, displayed in the feature callouts
  • Have Excel compute some results
  • Read the results computed by Excel (displayed in the lower-right portion of the spreadsheet - cells "L32" and "L33")
  • Use those values in the BuildIT process. They will be displayed to the user in a feedback message.

Example BuildIT model (already inspected):
BITExcelPython-buildit_view.png

Example Excel template:
BITExcelPython-excel_view.png

Walkthrough

Download the example files used in the walkthrough:

Excel Process Example.zip

  • Download and unzip all files contained in "Excel Process Example.zip" in the same folder
  • Play process "Excel Process Example.process" (press F5, or drag-and-drop in the viewport)
  • The process example can be examined by opening "Excel Process Example.py". This script follows a simple structure:
    • Define a dictionary for associating each feature property to report with a range (a cell address in the spreadsheet)
    • Copy the Excel template to a user-defined location, and open that copy for populating it
    • Populate the report, using the lookup table defined previously through a dictionary
      • Populating the spreadsheet will update its formulas dynamically and automatically, just as filling them in manually would
  • Read the results of some calculations performed by Excel
  • Display those results to the user