Friday, 4 December 2020

Working with the NBS specification data

With NBS Chorus and NBS Source, our vision is to (a) first and foremost to produce best-in-class platforms with great user experience and then (b) to open up the data for partners and those with basic programming skills to use.

With both, we have loads of exciting functionality planned for the main platforms, this means that opening up the data access will take a little longer. However, we do allow users to export specifications to the well-structured DOCX format.

Primarily this is for manipulation in Microsoft Word. But as a secondary point of interest, this means that hobbyist programmers can play with the data.

Last Saturday morning @mgjspidey on Twitter let me know that he'd written some code to generate a Revit Keynote file from the DOCX output. As I used to enjoy a bit of programming a while back, I took this as a challenge to dust off the old coding fingers and write some sample code that I'd share with the community. Having some spare holiday days mixed with Covid lockdown boredom also helped ;) 

As the most accessible coding language for Microsoft Office is probably VBA, I wrote some code and popped it up on GitHub.

Summaries of the four use cases are below. Feel free to download and amend the code to create your own use cases.

1. Microsoft Word Macro - Generate Keynote file from Chorus specification

Use case: Revit LT users cannot use the NBS Plug-in for Revit. So a keynote file is required for making annotations.

Coding solution: Open the DOCX file - run the macro - generate the keynote file.

NBS plan: Intend to implement in this within Chorus in 2021, in particular for small works customers.

Generate keynote file from published specification

2. Microsoft Word Macro - Prepare NBS legacy word-processing for importing into Chorus

Use case: NBS customers may have old word processing versions of NBS they want to import into Chorus as record/historic specifications. Unfortunately, the historic word processing format used does not have structure to it.

Coding solution: Open the DOCX file - run the macro - convert to a file that imports cleanly.

NBS plan: Incremental enhancements to the MS Word import feature will continue to be made.

The word-processing file format for the last 25 years :)

The macro loops through the document giving it structure

...and then import well-structured content into Chorus

3. Microsoft Word Macro - Prepare stylesheet for uploading to Chorus 

Use case: It can be quite time consuming to change the colour and font-style for all styles in an NBS print template document.

Coding solution: Open the DOCX file - run the macro - change all of the fonts and colours instantly.

NBS plan: No plan at this stage to develop this into the main software

Choose your heading colour and document font

All changes are made

4. Microsoft Excel Macro - Generate a pricing document

Use case: On small jobs that don't of bills of quantities, a priceable spreadsheet with specification references may be useful.

Coding solution: Open the XSLM file, specify which DOCX file to look at - run the macro - generate the pricing spreadsheet.

NBS plan: Intend to implement in this within Chorus in 2021, in particular for small works customers.

Browse to the DOCX file and click the button

Pricing sheet generated from specification sections

Calculation and currency field types added


I do realise that programming and working with data like this is not for everyone. But hopefully this will spark of other ideas of what the data inside specifications can be used for - ideas worked on can turn into well-worked functionality that makes it into the main product one day too.

No comments:

Post a Comment